GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72114
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BasicMinMaxHeap< T > Class Template Referenceabstract

#include <minmaxheap.h>

Inheritance diagram for BasicMinMaxHeap< T >:

Public Member Functions

 BasicMinMaxHeap (HeapIndex size)
 
virtual ~BasicMinMaxHeap (void)
 
bool empty (void) const
 
HeapIndex size () const
 
get (HeapIndex i) const
 
void insert (const T &elt)
 
bool min (T &elt) const
 
bool extract_min (T &elt)
 
bool max (T &elt) const
 
bool extract_max (T &elt)
 
bool extract_all_min (T &elt)
 
void reset ()
 
void clear ()
 
void destructiveVerify ()
 
void verify ()
 
void print () const
 
void print_range () const
 

Protected Member Functions

virtual void grow ()=0
 

Static Protected Member Functions

static T * allocateHeap (HeapIndex n)
 
static void freeHeap (T *)
 

Protected Attributes

HeapIndex maxsize
 
HeapIndex lastindex
 
T * A
 

Friends

ostream & operator<< (ostream &s, const BasicMinMaxHeap< T > &pq)
 

Detailed Description

template<class T>
class BasicMinMaxHeap< T >

Definition at line 88 of file minmaxheap.h.

Constructor & Destructor Documentation

template<class T >
virtual BasicMinMaxHeap< T >::~BasicMinMaxHeap ( void  )
inlinevirtual

Member Function Documentation

template<class T >
T * BasicMinMaxHeap< T >::allocateHeap ( HeapIndex  n)
staticprotected

Definition at line 656 of file minmaxheap.h.

Referenced by BasicMinMaxHeap< T >::BasicMinMaxHeap().

template<class T >
void BasicMinMaxHeap< T >::clear ( )

Definition at line 649 of file minmaxheap.h.

template<class T >
void BasicMinMaxHeap< T >::destructiveVerify ( )

Definition at line 684 of file minmaxheap.h.

References min, and XXX.

template<class T >
bool BasicMinMaxHeap< T >::empty ( void  ) const
inline

Definition at line 116 of file minmaxheap.h.

References BasicMinMaxHeap< T >::size().

template<class T >
bool BasicMinMaxHeap< T >::extract_all_min ( T &  elt)

Definition at line 557 of file minmaxheap.h.

References min.

template<class T >
bool BasicMinMaxHeap< T >::extract_max ( T &  elt)

Definition at line 581 of file minmaxheap.h.

template<class T >
bool BasicMinMaxHeap< T >::extract_min ( T &  elt)

Definition at line 540 of file minmaxheap.h.

Referenced by em_pqueue< T, Key >::em_pqueue().

template<class T >
void BasicMinMaxHeap< T >::freeHeap ( T *  p)
staticprotected

Definition at line 669 of file minmaxheap.h.

References free().

Referenced by BasicMinMaxHeap< T >::~BasicMinMaxHeap().

template<class T >
T BasicMinMaxHeap< T >::get ( HeapIndex  i) const
inline

Definition at line 122 of file minmaxheap.h.

References BasicMinMaxHeap< T >::A, and BasicMinMaxHeap< T >::size().

template<class T >
virtual void BasicMinMaxHeap< T >::grow ( )
protectedpure virtual
template<class T >
void BasicMinMaxHeap< T >::insert ( const T &  elt)

Definition at line 521 of file minmaxheap.h.

References MY_LOG_DEBUG_ID, and XXX.

template<class T >
bool BasicMinMaxHeap< T >::max ( T &  elt) const

Definition at line 615 of file minmaxheap.h.

template<class T >
bool BasicMinMaxHeap< T >::min ( T &  elt) const

Definition at line 603 of file minmaxheap.h.

template<class T >
void BasicMinMaxHeap< T >::print ( ) const

Definition at line 496 of file minmaxheap.h.

template<class T >
void BasicMinMaxHeap< T >::print_range ( ) const

Definition at line 506 of file minmaxheap.h.

References b, max, and min.

template<class T >
void BasicMinMaxHeap< T >::reset ( )

Definition at line 636 of file minmaxheap.h.

References MY_LOG_DEBUG_ID, and NULL.

template<class T >
void BasicMinMaxHeap< T >::verify ( )

Definition at line 720 of file minmaxheap.h.

Friends And Related Function Documentation

template<class T >
ostream& operator<< ( ostream &  s,
const BasicMinMaxHeap< T > &  pq 
)
friend

Definition at line 146 of file minmaxheap.h.

Field Documentation

template<class T >
HeapIndex BasicMinMaxHeap< T >::lastindex
protected
template<class T >
HeapIndex BasicMinMaxHeap< T >::maxsize
protected

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