Definition at line 42 of file cjkpitch.cpp.
◆ SimpleStats()
tesseract::SimpleStats::SimpleStats |
( |
| ) |
|
|
default |
◆ ~SimpleStats()
tesseract::SimpleStats::~SimpleStats |
( |
| ) |
|
|
default |
◆ Add()
void tesseract::SimpleStats::Add |
( |
float |
value | ) |
|
|
inline |
Definition at line 52 of file cjkpitch.cpp.
52 {
53 values_.push_back(
value);
54 finalized_ = false;
55 }
◆ Clear()
void tesseract::SimpleStats::Clear |
( |
| ) |
|
|
inline |
Definition at line 47 of file cjkpitch.cpp.
47 {
48 values_.clear();
49 finalized_ = false;
50 }
◆ empty()
bool tesseract::SimpleStats::empty |
( |
| ) |
const |
|
inline |
Definition at line 95 of file cjkpitch.cpp.
95 {
96 return values_.empty();
97 }
◆ Finish()
void tesseract::SimpleStats::Finish |
( |
| ) |
|
|
inline |
Definition at line 57 of file cjkpitch.cpp.
57 {
58 std::sort(values_.begin(), values_.end());
59 finalized_ = true;
60 }
◆ ile()
float tesseract::SimpleStats::ile |
( |
double |
frac | ) |
|
|
inline |
Definition at line 62 of file cjkpitch.cpp.
62 {
63 if (!finalized_) {
65 }
66 if (values_.empty()) {
67 return 0.0f;
68 }
69 if (frac >= 1.0) {
70 return values_.back();
71 }
72 if (frac <= 0.0 || values_.size() == 1) {
73 return values_[0];
74 }
75 int index = static_cast<int>((values_.size() - 1) * frac);
76 float reminder = (values_.size() - 1) * frac - index;
77
78 return values_[index] * (1.0f - reminder) + values_[index + 1] * reminder;
79 }
◆ median()
float tesseract::SimpleStats::median |
( |
| ) |
|
|
inline |
◆ minimum()
float tesseract::SimpleStats::minimum |
( |
| ) |
|
|
inline |
Definition at line 85 of file cjkpitch.cpp.
85 {
86 if (!finalized_) {
88 }
89 if (values_.empty()) {
90 return 0.0f;
91 }
92 return values_[0];
93 }
◆ size()
int tesseract::SimpleStats::size |
( |
| ) |
const |
|
inline |
Definition at line 99 of file cjkpitch.cpp.
99 {
100 return values_.size();
101 }
The documentation for this class was generated from the following file:
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/textord/cjkpitch.cpp