Classes | Public Member Functions | Protected Member Functions | Protected Attributes

DataStructures::Heap< weight_type, data_type, isMaxHeap > Class Template Reference

#include <DS_Heap.h>

Collaboration diagram for DataStructures::Heap< weight_type, data_type, isMaxHeap >:
Collaboration graph
[legend]

List of all members.

Classes

struct  HeapNode

Public Member Functions

 Heap ()
 ~Heap ()
void Push (const weight_type &weight, const data_type &data, const char *file, unsigned int line)
void StartSeries (void)
 Call before calling PushSeries, for a new series of items.
void PushSeries (const weight_type &weight, const data_type &data, const char *file, unsigned int line)
 If you are going to push a list of items, where the weights of the items on the list are in order and follow the heap order, PushSeries is faster than Push().
data_type Pop (const unsigned startingIndex)
data_type Peek (const unsigned startingIndex=0) const
weight_type PeekWeight (const unsigned startingIndex=0) const
void Clear (bool doNotDeallocateSmallBlocks, const char *file, unsigned int line)
data_type & operator[] (const unsigned int position) const
unsigned Size (void) const

Protected Member Functions

unsigned LeftChild (const unsigned i) const
unsigned RightChild (const unsigned i) const
unsigned Parent (const unsigned i) const
void Swap (const unsigned i, const unsigned j)

Protected Attributes

DataStructures::List< HeapNodeheap
bool optimizeNextSeriesPush

Detailed Description

template<class weight_type, class data_type, bool isMaxHeap>
class DataStructures::Heap< weight_type, data_type, isMaxHeap >

Definition at line 27 of file DS_Heap.h.


Constructor & Destructor Documentation

template<class weight_type , class data_type , bool isMaxHeap>
DataStructures::Heap< weight_type, data_type, isMaxHeap >::Heap (  ) 

Definition at line 62 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>
DataStructures::Heap< weight_type, data_type, isMaxHeap >::~Heap (  ) 

Definition at line 68 of file DS_Heap.h.


Member Function Documentation

template<class weight_type , class data_type , bool isMaxHeap>
void DataStructures::Heap< weight_type, data_type, isMaxHeap >::Clear ( bool  doNotDeallocateSmallBlocks,
const char *  file,
unsigned int  line 
)

Definition at line 243 of file DS_Heap.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class weight_type , class data_type , bool isMaxHeap>
unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::LeftChild ( const unsigned  i  )  const [protected]

Definition at line 260 of file DS_Heap.h.

Here is the caller graph for this function:

template<class weight_type , class data_type , bool isMaxHeap>
data_type & DataStructures::Heap< weight_type, data_type, isMaxHeap >::operator[] ( const unsigned int  position  )  const

Definition at line 249 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>
unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::Parent ( const unsigned  i  )  const [protected]

Definition at line 272 of file DS_Heap.h.

Here is the caller graph for this function:

template<class weight_type , class data_type , bool isMaxHeap>
data_type DataStructures::Heap< weight_type, data_type, isMaxHeap >::Peek ( const unsigned  startingIndex = 0  )  const

Definition at line 231 of file DS_Heap.h.

Here is the caller graph for this function:

template<class weight_type , class data_type , bool isMaxHeap>
weight_type DataStructures::Heap< weight_type, data_type, isMaxHeap >::PeekWeight ( const unsigned  startingIndex = 0  )  const

Definition at line 237 of file DS_Heap.h.

Here is the caller graph for this function:

template<class weight_type , class data_type , bool isMaxHeap>
data_type DataStructures::Heap< weight_type, data_type, isMaxHeap >::Pop ( const unsigned  startingIndex  ) 

Definition at line 154 of file DS_Heap.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class weight_type, class data_type, bool isMaxHeap>
void DataStructures::Heap< weight_type, data_type, isMaxHeap >::Push ( const weight_type &  weight,
const data_type &  data,
const char *  file,
unsigned int  line 
)

Definition at line 119 of file DS_Heap.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class weight_type, class data_type, bool isMaxHeap>
void DataStructures::Heap< weight_type, data_type, isMaxHeap >::PushSeries ( const weight_type &  weight,
const data_type &  data,
const char *  file,
unsigned int  line 
)

If you are going to push a list of items, where the weights of the items on the list are in order and follow the heap order, PushSeries is faster than Push().

Definition at line 74 of file DS_Heap.h.

Here is the call graph for this function:

template<class weight_type , class data_type , bool isMaxHeap>
unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::RightChild ( const unsigned  i  )  const [protected]

Definition at line 266 of file DS_Heap.h.

Here is the caller graph for this function:

template<class weight_type , class data_type , bool isMaxHeap>
unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::Size ( void   )  const

Definition at line 254 of file DS_Heap.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class weight_type, class data_type, bool isMaxHeap>
void DataStructures::Heap< weight_type, data_type, isMaxHeap >::StartSeries ( void   )  [inline]

Call before calling PushSeries, for a new series of items.

Definition at line 42 of file DS_Heap.h.

template<class weight_type , class data_type , bool isMaxHeap>
void DataStructures::Heap< weight_type, data_type, isMaxHeap >::Swap ( const unsigned  i,
const unsigned  j 
) [protected]

Definition at line 281 of file DS_Heap.h.

Here is the caller graph for this function:


Member Data Documentation

template<class weight_type, class data_type, bool isMaxHeap>
DataStructures::List<HeapNode> DataStructures::Heap< weight_type, data_type, isMaxHeap >::heap [protected]

Definition at line 57 of file DS_Heap.h.

template<class weight_type, class data_type, bool isMaxHeap>
bool DataStructures::Heap< weight_type, data_type, isMaxHeap >::optimizeNextSeriesPush [protected]

Definition at line 58 of file DS_Heap.h.


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