GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
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 81 of file minmaxheap.h.

Constructor & Destructor Documentation

◆ BasicMinMaxHeap()

◆ ~BasicMinMaxHeap()

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

Member Function Documentation

◆ allocateHeap()

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

Definition at line 695 of file minmaxheap.h.

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

◆ clear()

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

Definition at line 688 of file minmaxheap.h.

◆ destructiveVerify()

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

Definition at line 722 of file minmaxheap.h.

References assert, min, and XXX.

◆ empty()

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

Definition at line 111 of file minmaxheap.h.

References BasicMinMaxHeap< T >::size().

◆ extract_all_min()

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

Definition at line 587 of file minmaxheap.h.

References min.

◆ extract_max()

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

Definition at line 614 of file minmaxheap.h.

References assert.

◆ extract_min()

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

Definition at line 568 of file minmaxheap.h.

References assert.

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

◆ freeHeap()

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

Definition at line 708 of file minmaxheap.h.

References free().

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

◆ get()

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

Definition at line 118 of file minmaxheap.h.

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

◆ grow()

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

◆ insert()

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

Definition at line 547 of file minmaxheap.h.

◆ max()

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

Definition at line 653 of file minmaxheap.h.

References assert.

◆ min()

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

Definition at line 639 of file minmaxheap.h.

References assert.

◆ print()

template<class T >
void BasicMinMaxHeap< T >::print

Definition at line 522 of file minmaxheap.h.

◆ print_range()

template<class T >
void BasicMinMaxHeap< T >::print_range

Definition at line 533 of file minmaxheap.h.

◆ reset()

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

Definition at line 675 of file minmaxheap.h.

References assert, and MY_LOG_DEBUG_ID.

◆ size()

◆ verify()

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

Definition at line 758 of file minmaxheap.h.

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

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

◆ maxsize

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

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