#include <sorthelper.h>
template<typename T>
class SortHelper< T >
Definition at line 36 of file sorthelper.h.
Definition at line 63 of file sorthelper.h.
65 for (
int i = 0; i < counts_.size(); ++i) {
66 if (counts_[i].value == value) {
67 counts_[i].count +=
count;
71 SortPair<T> new_pair = {value,
count};
72 counts_.push_back(SortPair<T>(new_pair));
template<typename T >
| int SortHelper< T >::MaxCount |
( |
T * |
max_value | ) |
const |
|
inline |
Definition at line 78 of file sorthelper.h.
80 for (
int i = 0; i < counts_.size(); ++i) {
81 if (counts_[i].
count > best_count) {
82 best_count = counts_[i].count;
83 if (max_value !=
NULL)
84 *max_value = counts_[i].value;
Definition at line 91 of file sorthelper.h.
static int SortPairsByCount(const void *v1, const void *v2)
Definition at line 96 of file sorthelper.h.
static int SortPairsByValue(const void *v1, const void *v2)
template<typename T >
| static int SortHelper< T >::SortPairsByCount |
( |
const void * |
v1, |
|
|
const void * |
v2 |
|
) |
| |
|
inlinestatic |
Definition at line 44 of file sorthelper.h.
45 const SortPair<T>* p1 =
reinterpret_cast<const SortPair<T>*
>(v1);
46 const SortPair<T>* p2 =
reinterpret_cast<const SortPair<T>*
>(v2);
47 return p2->count - p1->count;
template<typename T >
| static int SortHelper< T >::SortPairsByValue |
( |
const void * |
v1, |
|
|
const void * |
v2 |
|
) |
| |
|
inlinestatic |
Definition at line 50 of file sorthelper.h.
51 const SortPair<T>* p1 =
reinterpret_cast<const SortPair<T>*
>(v1);
52 const SortPair<T>* p2 =
reinterpret_cast<const SortPair<T>*
>(v2);
53 if (p2->value - p1->value < 0)
return -1;
54 if (p2->value - p1->value > 0)
return 1;
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/ccutil/sorthelper.h