GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-f63024f571
|
#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 81 of file minmaxheap.h.
|
inline |
Definition at line 93 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, BasicMinMaxHeap< T >::allocateHeap(), BasicMinMaxHeap< T >::lastindex, BasicMinMaxHeap< T >::maxsize, MY_LOG_DEBUG_ID, and BasicMinMaxHeap< T >::size().
|
inlinevirtual |
Definition at line 105 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, BasicMinMaxHeap< T >::freeHeap(), and MY_LOG_DEBUG_ID.
|
staticprotected |
Definition at line 695 of file minmaxheap.h.
Referenced by BasicMinMaxHeap< T >::BasicMinMaxHeap().
void BasicMinMaxHeap< T >::clear |
Definition at line 688 of file minmaxheap.h.
void BasicMinMaxHeap< T >::destructiveVerify |
Definition at line 722 of file minmaxheap.h.
|
inline |
Definition at line 111 of file minmaxheap.h.
References BasicMinMaxHeap< T >::size().
bool BasicMinMaxHeap< T >::extract_all_min | ( | T & | elt | ) |
Definition at line 587 of file minmaxheap.h.
References min.
bool BasicMinMaxHeap< T >::extract_max | ( | T & | elt | ) |
Definition at line 614 of file minmaxheap.h.
References assert.
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().
|
staticprotected |
Definition at line 708 of file minmaxheap.h.
References free().
Referenced by BasicMinMaxHeap< T >::~BasicMinMaxHeap().
|
inline |
Definition at line 118 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, assert, and BasicMinMaxHeap< T >::size().
|
protectedpure virtual |
Implemented in UnboundedMinMaxHeap< T >, and MinMaxHeap< T >.
void BasicMinMaxHeap< T >::insert | ( | const T & | elt | ) |
Definition at line 547 of file minmaxheap.h.
bool BasicMinMaxHeap< T >::max | ( | T & | elt | ) | const |
Definition at line 653 of file minmaxheap.h.
References assert.
bool BasicMinMaxHeap< T >::min | ( | T & | elt | ) | const |
Definition at line 639 of file minmaxheap.h.
References assert.
void BasicMinMaxHeap< T >::print |
Definition at line 522 of file minmaxheap.h.
void BasicMinMaxHeap< T >::print_range |
Definition at line 533 of file minmaxheap.h.
void BasicMinMaxHeap< T >::reset |
Definition at line 675 of file minmaxheap.h.
References assert, and MY_LOG_DEBUG_ID.
|
inline |
Definition at line 112 of file minmaxheap.h.
References BasicMinMaxHeap< T >::A, assert, and BasicMinMaxHeap< T >::lastindex.
Referenced by BasicMinMaxHeap< T >::BasicMinMaxHeap(), em_pqueue< T, Key >::em_pqueue(), BasicMinMaxHeap< T >::empty(), MinMaxHeap< T >::full(), and BasicMinMaxHeap< T >::get().
void BasicMinMaxHeap< T >::verify |
Definition at line 758 of file minmaxheap.h.
|
friend |
Definition at line 146 of file minmaxheap.h.
|
protected |
Definition at line 85 of file minmaxheap.h.
Referenced by BasicMinMaxHeap< T >::BasicMinMaxHeap(), BasicMinMaxHeap< T >::get(), BasicMinMaxHeap< T >::size(), and BasicMinMaxHeap< T >::~BasicMinMaxHeap().
|
protected |
Definition at line 84 of file minmaxheap.h.
Referenced by BasicMinMaxHeap< T >::BasicMinMaxHeap(), and BasicMinMaxHeap< T >::size().
|
protected |
Definition at line 83 of file minmaxheap.h.
Referenced by BasicMinMaxHeap< T >::BasicMinMaxHeap(), MinMaxHeap< T >::full(), and MinMaxHeap< T >::get_maxsize().