#include <DS_Heap.h>
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< HeapNode > | heap |
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>
template<class weight_type , class data_type , bool isMaxHeap>
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 | |
|
) |
| | |
template<class weight_type , class data_type , bool isMaxHeap>
unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::LeftChild |
( |
const unsigned |
i |
) |
const [protected] |
template<class weight_type , class data_type , bool isMaxHeap>
data_type & DataStructures::Heap< weight_type, data_type, isMaxHeap >::operator[] |
( |
const unsigned int |
position |
) |
const |
template<class weight_type , class data_type , bool isMaxHeap>
unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::Parent |
( |
const unsigned |
i |
) |
const [protected] |
template<class weight_type , class data_type , bool isMaxHeap>
data_type DataStructures::Heap< weight_type, data_type, isMaxHeap >::Peek |
( |
const unsigned |
startingIndex = 0 |
) |
const |
template<class weight_type , class data_type , bool isMaxHeap>
weight_type DataStructures::Heap< weight_type, data_type, isMaxHeap >::PeekWeight |
( |
const unsigned |
startingIndex = 0 |
) |
const |
template<class weight_type , class data_type , bool isMaxHeap>
data_type DataStructures::Heap< weight_type, data_type, isMaxHeap >::Pop |
( |
const unsigned |
startingIndex |
) |
|
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 | |
|
) |
| | |
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.
template<class weight_type , class data_type , bool isMaxHeap>
unsigned DataStructures::Heap< weight_type, data_type, isMaxHeap >::RightChild |
( |
const unsigned |
i |
) |
const [protected] |
template<class weight_type , class data_type , bool isMaxHeap>
template<class weight_type, class data_type, bool isMaxHeap>
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] |
Member Data Documentation
template<class weight_type, class data_type, bool isMaxHeap>
template<class weight_type, class data_type, bool isMaxHeap>
The documentation for this class was generated from the following file: