GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
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

◆ BasicMinMaxHeap()

template<class T >
BasicMinMaxHeap< T >::BasicMinMaxHeap ( HeapIndex  size)
inline

Definition at line 100 of file minmaxheap.h.

References BasicMinMaxHeap< T >::allocateHeap(), and MY_LOG_DEBUG_ID.

◆ ~BasicMinMaxHeap()

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

Definition at line 111 of file minmaxheap.h.

References BasicMinMaxHeap< T >::freeHeap(), and MY_LOG_DEBUG_ID.

Member Function Documentation

◆ allocateHeap()

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

◆ clear()

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

Definition at line 649 of file minmaxheap.h.

References BasicMinMaxHeap< T >::lastindex.

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

◆ destructiveVerify()

◆ empty()

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

Definition at line 116 of file minmaxheap.h.

References BasicMinMaxHeap< T >::size().

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

◆ extract_all_min()

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

◆ extract_max()

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

Definition at line 581 of file minmaxheap.h.

References BasicMinMaxHeap< T >::A, assert, and BasicMinMaxHeap< T >::lastindex.

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

◆ extract_min()

◆ freeHeap()

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

◆ get()

◆ grow()

template<class T >
virtual void BasicMinMaxHeap< T >::grow ( )
protectedpure virtual

◆ insert()

◆ max()

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

Definition at line 615 of file minmaxheap.h.

References BasicMinMaxHeap< T >::A, assert, and BasicMinMaxHeap< T >::lastindex.

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

◆ min()

◆ print()

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

◆ print_range()

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

Definition at line 506 of file minmaxheap.h.

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

◆ reset()

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

◆ size()

◆ verify()

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 146 of file minmaxheap.h.

Field Documentation

◆ A

◆ lastindex

◆ maxsize


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