GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-ee9fa48798
MinMaxHeap< T > Class Template Reference

#include <minmaxheap.h>

Inheritance diagram for MinMaxHeap< T >:
Collaboration diagram for MinMaxHeap< T >:

Public Member Functions

 MinMaxHeap (HeapIndex size)
 
virtual ~MinMaxHeap ()
 
bool full (void) const
 
HeapIndex get_maxsize () const
 
HeapIndex fill (T *arr, HeapIndex n)
 
- Public Member Functions inherited from BasicMinMaxHeap< T >
 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 ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from BasicMinMaxHeap< T >
static T * allocateHeap (HeapIndex n)
 
static void freeHeap (T *)
 
- Protected Attributes inherited from BasicMinMaxHeap< T >
HeapIndex maxsize
 
HeapIndex lastindex
 
T * A
 

Detailed Description

template<class T>
class MinMaxHeap< T >

Definition at line 781 of file minmaxheap.h.

Constructor & Destructor Documentation

◆ MinMaxHeap()

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

Definition at line 783 of file minmaxheap.h.

◆ ~MinMaxHeap()

template<class T >
virtual MinMaxHeap< T >::~MinMaxHeap ( )
inlinevirtual

Definition at line 784 of file minmaxheap.h.

Member Function Documentation

◆ fill()

template<class T >
HeapIndex MinMaxHeap< T >::fill ( T *  arr,
HeapIndex  n 
)

Definition at line 803 of file minmaxheap.h.

References assert, and full.

◆ full()

template<class T >
bool MinMaxHeap< T >::full ( void  ) const
inline

Definition at line 785 of file minmaxheap.h.

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

◆ get_maxsize()

template<class T >
HeapIndex MinMaxHeap< T >::get_maxsize ( ) const
inline

Definition at line 786 of file minmaxheap.h.

References BasicMinMaxHeap< T >::maxsize.

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

◆ grow()

template<class T >
virtual void MinMaxHeap< T >::grow ( )
inlineprotectedvirtual

Implements BasicMinMaxHeap< T >.

Definition at line 790 of file minmaxheap.h.

References assert.


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