#include <genericheap.h>
template<typename Pair>
class tesseract::GenericHeap< Pair >
Definition at line 58 of file genericheap.h.
◆ GenericHeap() [1/2]
◆ GenericHeap() [2/2]
Definition at line 63 of file genericheap.h.
64 heap_.reserve(initial_size);
◆ clear()
◆ empty()
◆ get()
◆ heap()
◆ IndexOfWorst()
Definition at line 165 of file genericheap.h.
166 int heap_size = heap_.size();
167 if (heap_size == 0) {
174 int worst_index = heap_size - 1;
175 int end_parent = ParentNode(worst_index);
176 for (
int i = worst_index - 1; i > end_parent; --i) {
177 if (heap_[worst_index] < heap_[i]) {
◆ PeekTop()
◆ PeekWorst()
◆ Pop()
Definition at line 120 of file genericheap.h.
121 int new_size = heap_.size() - 1;
125 if (entry !=
nullptr) {
131 Pair hole_pair = heap_[new_size];
132 heap_.resize(new_size);
133 int hole_index = SiftDown(0, hole_pair);
134 heap_[hole_index] = hole_pair;
136 heap_.resize(new_size);
◆ PopWorst()
Definition at line 144 of file genericheap.h.
146 if (worst_index < 0) {
150 if (entry !=
nullptr) {
151 *entry = heap_[worst_index];
153 int heap_size = heap_.size() - 1;
156 Pair hole_pair = heap_[heap_size];
157 int hole_index = SiftUp(worst_index, hole_pair);
158 heap_[hole_index] = hole_pair;
160 heap_.resize(heap_size);
◆ Push()
Definition at line 95 of file genericheap.h.
96 int hole_index = heap_.size();
101 heap_.push_back(*entry);
102 *entry = heap_.back();
103 hole_index = SiftUp(hole_index, *entry);
104 heap_[hole_index] = *entry;
◆ Reshuffle()
Definition at line 193 of file genericheap.h.
194 int index = pair - &heap_[0];
195 Pair hole_pair = heap_[index];
196 index = SiftDown(index, hole_pair);
197 index = SiftUp(index, hole_pair);
198 heap_[index] = hole_pair;
◆ size()
◆ size_reserved()
Definition at line 74 of file genericheap.h.
75 return heap_.size_reserved();
The documentation for this class was generated from the following file: