GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
|
#include <minmaxheap.h>
Public Member Functions | |
BasicMinMaxHeap (HeapIndex size) | |
virtual | ~BasicMinMaxHeap (void) |
bool | empty (void) const |
HeapIndex | size () const |
T | 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) |
Definition at line 88 of file minmaxheap.h.
|
inline |
Definition at line 100 of file minmaxheap.h.
References BasicMinMaxHeap< T >::allocateHeap(), and MY_LOG_DEBUG_ID.
|
inlinevirtual |
Definition at line 111 of file minmaxheap.h.
References BasicMinMaxHeap< T >::freeHeap(), and MY_LOG_DEBUG_ID.
|
staticprotected |
Definition at line 656 of file minmaxheap.h.
Referenced by BasicMinMaxHeap< T >::BasicMinMaxHeap(), UnboundedMinMaxHeap< T >::grow(), BasicMinMaxHeap< T >::insert(), and BasicMinMaxHeap< T >::verify().
void BasicMinMaxHeap< T >::clear | ( | ) |
Definition at line 649 of file minmaxheap.h.
References BasicMinMaxHeap< T >::lastindex.
Referenced by BasicMinMaxHeap< T >::get().
void BasicMinMaxHeap< T >::destructiveVerify | ( | ) |
Definition at line 684 of file minmaxheap.h.
References assert, BasicMinMaxHeap< T >::extract_min(), BasicMinMaxHeap< T >::min(), BasicMinMaxHeap< T >::print(), BasicMinMaxHeap< T >::size(), and XXX.
Referenced by BasicMinMaxHeap< T >::get(), and BasicMinMaxHeap< T >::verify().
|
inline |
Definition at line 116 of file minmaxheap.h.
References BasicMinMaxHeap< T >::size().
Referenced by BasicMinMaxHeap< T >::reset().
bool BasicMinMaxHeap< T >::extract_all_min | ( | T & | elt | ) |
Definition at line 557 of file minmaxheap.h.
References BasicMinMaxHeap< T >::extract_min(), and BasicMinMaxHeap< T >::min().
Referenced by BasicMinMaxHeap< T >::get().
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().
bool BasicMinMaxHeap< T >::extract_min | ( | T & | elt | ) |
Definition at line 540 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, assert, and BasicMinMaxHeap< T >::lastindex.
Referenced by BasicMinMaxHeap< T >::destructiveVerify(), em_pqueue< T, Key >::em_pqueue(), BasicMinMaxHeap< T >::extract_all_min(), and BasicMinMaxHeap< T >::get().
|
staticprotected |
Definition at line 669 of file minmaxheap.h.
References free().
Referenced by UnboundedMinMaxHeap< T >::grow(), BasicMinMaxHeap< T >::reset(), BasicMinMaxHeap< T >::verify(), and BasicMinMaxHeap< T >::~BasicMinMaxHeap().
|
inline |
Definition at line 122 of file minmaxheap.h.
References assert, BasicMinMaxHeap< T >::clear(), BasicMinMaxHeap< T >::destructiveVerify(), BasicMinMaxHeap< T >::extract_all_min(), BasicMinMaxHeap< T >::extract_max(), BasicMinMaxHeap< T >::extract_min(), BasicMinMaxHeap< T >::insert(), BasicMinMaxHeap< T >::max(), BasicMinMaxHeap< T >::min(), BasicMinMaxHeap< T >::print(), BasicMinMaxHeap< T >::print_range(), BasicMinMaxHeap< T >::reset(), BasicMinMaxHeap< T >::size(), and BasicMinMaxHeap< T >::verify().
|
protectedpure virtual |
Implemented in UnboundedMinMaxHeap< T >, and MinMaxHeap< T >.
Referenced by BasicMinMaxHeap< T >::insert(), and UnboundedMinMaxHeap< T >::~UnboundedMinMaxHeap().
void BasicMinMaxHeap< T >::insert | ( | const T & | elt | ) |
Definition at line 521 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, BasicMinMaxHeap< T >::allocateHeap(), BasicMinMaxHeap< T >::grow(), BasicMinMaxHeap< T >::lastindex, BasicMinMaxHeap< T >::maxsize, MY_LOG_DEBUG_ID, and XXX.
Referenced by MinMaxHeap< T >::fill(), and BasicMinMaxHeap< T >::get().
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().
bool BasicMinMaxHeap< T >::min | ( | T & | elt | ) | const |
Definition at line 603 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, assert, and BasicMinMaxHeap< T >::lastindex.
Referenced by BasicMinMaxHeap< T >::destructiveVerify(), BasicMinMaxHeap< T >::extract_all_min(), and BasicMinMaxHeap< T >::get().
void BasicMinMaxHeap< T >::print | ( | ) | const |
Definition at line 496 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, and BasicMinMaxHeap< T >::size().
Referenced by BasicMinMaxHeap< T >::destructiveVerify(), and BasicMinMaxHeap< T >::get().
void BasicMinMaxHeap< T >::print_range | ( | ) | const |
Definition at line 506 of file minmaxheap.h.
Referenced by BasicMinMaxHeap< T >::get().
void BasicMinMaxHeap< T >::reset | ( | ) |
Definition at line 636 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, assert, BasicMinMaxHeap< T >::empty(), BasicMinMaxHeap< T >::freeHeap(), MY_LOG_DEBUG_ID, and NULL.
Referenced by BasicMinMaxHeap< T >::get().
|
inline |
Definition at line 117 of file minmaxheap.h.
References assert, and BasicMinMaxHeap< T >::lastindex.
Referenced by BasicMinMaxHeap< T >::destructiveVerify(), em_pqueue< T, Key >::em_pqueue(), BasicMinMaxHeap< T >::empty(), MinMaxHeap< T >::fill(), MinMaxHeap< T >::full(), BasicMinMaxHeap< T >::get(), UnboundedMinMaxHeap< T >::grow(), BasicMinMaxHeap< T >::print(), and BasicMinMaxHeap< T >::verify().
void BasicMinMaxHeap< T >::verify | ( | ) |
Definition at line 720 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, BasicMinMaxHeap< T >::allocateHeap(), BasicMinMaxHeap< T >::destructiveVerify(), BasicMinMaxHeap< T >::freeHeap(), BasicMinMaxHeap< T >::lastindex, BasicMinMaxHeap< T >::maxsize, and BasicMinMaxHeap< T >::size().
Referenced by BasicMinMaxHeap< T >::get().
|
friend |
Definition at line 146 of file minmaxheap.h.
|
protected |
Definition at line 92 of file minmaxheap.h.
Referenced by BasicMinMaxHeap< T >::extract_max(), BasicMinMaxHeap< T >::extract_min(), UnboundedMinMaxHeap< T >::grow(), BasicMinMaxHeap< T >::insert(), BasicMinMaxHeap< T >::max(), BasicMinMaxHeap< T >::min(), BasicMinMaxHeap< T >::print(), BasicMinMaxHeap< T >::reset(), and BasicMinMaxHeap< T >::verify().
|
protected |
Definition at line 91 of file minmaxheap.h.
Referenced by BasicMinMaxHeap< T >::clear(), BasicMinMaxHeap< T >::extract_max(), BasicMinMaxHeap< T >::extract_min(), BasicMinMaxHeap< T >::insert(), BasicMinMaxHeap< T >::max(), BasicMinMaxHeap< T >::min(), BasicMinMaxHeap< T >::size(), and BasicMinMaxHeap< T >::verify().
|
protected |
Definition at line 90 of file minmaxheap.h.
Referenced by MinMaxHeap< T >::fill(), MinMaxHeap< T >::full(), MinMaxHeap< T >::get_maxsize(), UnboundedMinMaxHeap< T >::grow(), BasicMinMaxHeap< T >::insert(), and BasicMinMaxHeap< T >::verify().