GRASS Programmer's Manual  6.4.2(2012)
BasicMinMaxHeap< T > Class Template Reference

#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 71 of file minmaxheap.h.


Constructor & Destructor Documentation

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

Definition at line 83 of file minmaxheap.h.

References MY_LOG_DEBUG_ID.

template<class T >
virtual BasicMinMaxHeap< T >::~BasicMinMaxHeap ( void  ) [inline, virtual]

Definition at line 94 of file minmaxheap.h.

References MY_LOG_DEBUG_ID.


Member Function Documentation

template<class T >
T * BasicMinMaxHeap< T >::allocateHeap ( HeapIndex  n) [static, protected]

Definition at line 639 of file minmaxheap.h.

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

Definition at line 632 of file minmaxheap.h.

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

Definition at line 667 of file minmaxheap.h.

References min, and XXX.

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

Definition at line 99 of file minmaxheap.h.

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

Definition at line 540 of file minmaxheap.h.

References min.

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

Definition at line 564 of file minmaxheap.h.

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

Definition at line 523 of file minmaxheap.h.

template<class T >
void BasicMinMaxHeap< T >::freeHeap ( T *  p) [static, protected]

Definition at line 652 of file minmaxheap.h.

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

Definition at line 105 of file minmaxheap.h.

template<class T >
virtual void BasicMinMaxHeap< T >::grow ( ) [protected, pure virtual]
template<class T >
void BasicMinMaxHeap< T >::insert ( const T &  elt)

Definition at line 504 of file minmaxheap.h.

References MY_LOG_DEBUG_ID, and XXX.

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

Definition at line 598 of file minmaxheap.h.

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

Definition at line 586 of file minmaxheap.h.

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

Definition at line 479 of file minmaxheap.h.

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

Definition at line 489 of file minmaxheap.h.

References b, max, and min.

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

Definition at line 619 of file minmaxheap.h.

References MY_LOG_DEBUG_ID, and NULL.

template<class T >
HeapIndex BasicMinMaxHeap< T >::size ( ) const [inline]
template<class T >
void BasicMinMaxHeap< T >::verify ( )

Definition at line 703 of file minmaxheap.h.


Friends And Related Function Documentation

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

Definition at line 129 of file minmaxheap.h.


Field Documentation

template<class T >
T* BasicMinMaxHeap< T >::A [protected]

Definition at line 75 of file minmaxheap.h.

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

Definition at line 74 of file minmaxheap.h.

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

Definition at line 73 of file minmaxheap.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines