20 #ifndef TESSERACT_CCUTIL_SORTHELPER_H_ 21 #define TESSERACT_CCUTIL_SORTHELPER_H_ 24 #include "genericvector.h" 67 for (
int i = 0; i <
counts_.size(); ++i) {
68 if (
counts_[i].value == value) {
81 int best_count = -INT32_MAX;
82 for (
int i = 0; i <
counts_.size(); ++i) {
85 if (max_value !=
nullptr)
108 #endif // TESSERACT_CCUTIL_SORTHELPER_H_. const GenericVector< SortPair< T > > & SortByValue()
Definition: sorthelper.h:98
int count
Definition: sorthelper.h:41
const GenericVector< SortPair< T > > & SortByCount()
Definition: sorthelper.h:93
SortHelper(int sizehint)
Definition: sorthelper.h:59
static int SortPairsByValue(const void *v1, const void *v2)
Definition: sorthelper.h:50
void Add(T value, int count)
Definition: sorthelper.h:65
GenericVector< SortPair< T > > counts_
Definition: sorthelper.h:104
static int SortPairsByCount(const void *v1, const void *v2)
Definition: sorthelper.h:44
int MaxCount(T *max_value) const
Definition: sorthelper.h:80
Definition: sorthelper.h:39
Definition: sorthelper.h:36
PairT value
Definition: sorthelper.h:40