tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
tesseract::GenericHeap< Pair > Class Template Reference

#include <genericheap.h>

Collaboration diagram for tesseract::GenericHeap< Pair >:

Public Member Functions

 GenericHeap ()=default
 
 GenericHeap (int initial_size)
 
bool empty () const
 
int size () const
 
int size_reserved () const
 
void clear ()
 
GenericVector< Pair > * heap ()
 
const Pair & get (int index) const
 
void Push (Pair *entry)
 
const Pair & PeekTop () const
 
const Pair & PeekWorst () const
 
bool Pop (Pair *entry)
 
bool PopWorst (Pair *entry)
 
int IndexOfWorst () const
 
void Reshuffle (Pair *pair)
 

Private Member Functions

int SiftUp (int hole_index, const Pair &pair)
 
int SiftDown (int hole_index, const Pair &pair)
 
int ParentNode (int index) const
 
int LeftChild (int index) const
 

Private Attributes

GenericVector< Pair > heap_
 

Constructor & Destructor Documentation

◆ GenericHeap() [1/2]

template<typename Pair>
tesseract::GenericHeap< Pair >::GenericHeap ( )
default

◆ GenericHeap() [2/2]

template<typename Pair>
tesseract::GenericHeap< Pair >::GenericHeap ( int  initial_size)
inlineexplicit

Member Function Documentation

◆ clear()

template<typename Pair>
void tesseract::GenericHeap< Pair >::clear ( )
inline

◆ empty()

template<typename Pair>
bool tesseract::GenericHeap< Pair >::empty ( ) const
inline

◆ get()

template<typename Pair>
const Pair& tesseract::GenericHeap< Pair >::get ( int  index) const
inline

◆ heap()

template<typename Pair>
GenericVector<Pair>* tesseract::GenericHeap< Pair >::heap ( )
inline

◆ IndexOfWorst()

template<typename Pair>
int tesseract::GenericHeap< Pair >::IndexOfWorst ( ) const
inline

◆ LeftChild()

template<typename Pair>
int tesseract::GenericHeap< Pair >::LeftChild ( int  index) const
inlineprivate

◆ ParentNode()

template<typename Pair>
int tesseract::GenericHeap< Pair >::ParentNode ( int  index) const
inlineprivate

◆ PeekTop()

template<typename Pair>
const Pair& tesseract::GenericHeap< Pair >::PeekTop ( ) const
inline

◆ PeekWorst()

template<typename Pair>
const Pair& tesseract::GenericHeap< Pair >::PeekWorst ( ) const
inline

◆ Pop()

template<typename Pair>
bool tesseract::GenericHeap< Pair >::Pop ( Pair *  entry)
inline

◆ PopWorst()

template<typename Pair>
bool tesseract::GenericHeap< Pair >::PopWorst ( Pair *  entry)
inline

◆ Push()

template<typename Pair>
void tesseract::GenericHeap< Pair >::Push ( Pair *  entry)
inline

◆ Reshuffle()

template<typename Pair>
void tesseract::GenericHeap< Pair >::Reshuffle ( Pair *  pair)
inline

◆ SiftDown()

template<typename Pair>
int tesseract::GenericHeap< Pair >::SiftDown ( int  hole_index,
const Pair &  pair 
)
inlineprivate

◆ SiftUp()

template<typename Pair>
int tesseract::GenericHeap< Pair >::SiftUp ( int  hole_index,
const Pair &  pair 
)
inlineprivate

◆ size()

template<typename Pair>
int tesseract::GenericHeap< Pair >::size ( ) const
inline

◆ size_reserved()

template<typename Pair>
int tesseract::GenericHeap< Pair >::size_reserved ( ) const
inline

Member Data Documentation

◆ heap_

template<typename Pair>
GenericVector<Pair> tesseract::GenericHeap< Pair >::heap_
private

The documentation for this class was generated from the following file: