proteus  1.2.0
C/C++/Fortran libraries
Public Types | Public Member Functions | Protected Attributes | List of all members
StupidHeap Class Reference

#include </home/cekees/proteus/proteus/stupidheap.h>

Collaboration diagram for StupidHeap:
[legend]

Public Types

typedef int KeyType
 
typedef double ValueType
 
typedef std::pair< KeyType, ValueTypeEntryType
 
typedef std::vector< EntryType >::size_type PositionType
 

Public Member Functions

 StupidHeap ()
 
bool isEmpty () const
 
bool insert (KeyType key, ValueType val, int verbose=0)
 
bool insertWithCheckForExistingKey (KeyType key, ValueType val, int verbose=0)
 
EntryType pop (int verbose=0)
 
bool updateNode (KeyType key, ValueType newval, int verbose=0)
 
bool updateNodeWithMin (KeyType key, ValueType newval, int verbose=0)
 
bool upHeap (PositionType pos, int verbose=0)
 
bool downHeap (PositionType pos, int verbose=0)
 
bool checkHeap () const
 
bool printHeap () const
 

Protected Attributes

std::vector< EntryTypeheap
 
std::map< KeyType, PositionTypeheapPos
 

Detailed Description

Definition at line 11 of file stupidheap.h.

Member Typedef Documentation

Definition at line 22 of file stupidheap.h.

typedef int StupidHeap::KeyType

Definition at line 21 of file stupidheap.h.

typedef std::vector<EntryType>::size_type StupidHeap::PositionType

Definition at line 23 of file stupidheap.h.

typedef double StupidHeap::ValueType

Definition at line 21 of file stupidheap.h.

Constructor & Destructor Documentation

StupidHeap::StupidHeap ( )
inline

Definition at line 24 of file stupidheap.h.

Member Function Documentation

bool StupidHeap::checkHeap ( ) const
inline

Definition at line 102 of file stupidheap.h.

bool StupidHeap::downHeap ( StupidHeap::PositionType  pos,
int  verbose = 0 
)

Definition at line 27 of file stupidheap.cpp.

bool StupidHeap::insert ( KeyType  key,
ValueType  val,
int  verbose = 0 
)
inline

Definition at line 32 of file stupidheap.h.

bool StupidHeap::insertWithCheckForExistingKey ( KeyType  key,
ValueType  val,
int  verbose = 0 
)
inline

Definition at line 39 of file stupidheap.h.

bool StupidHeap::isEmpty ( ) const
inline

Definition at line 27 of file stupidheap.h.

EntryType StupidHeap::pop ( int  verbose = 0)
inline

Definition at line 55 of file stupidheap.h.

bool StupidHeap::printHeap ( ) const

Definition at line 69 of file stupidheap.cpp.

bool StupidHeap::updateNode ( KeyType  key,
ValueType  newval,
int  verbose = 0 
)
inline

Definition at line 74 of file stupidheap.h.

bool StupidHeap::updateNodeWithMin ( KeyType  key,
ValueType  newval,
int  verbose = 0 
)
inline

Definition at line 85 of file stupidheap.h.

bool StupidHeap::upHeap ( StupidHeap::PositionType  pos,
int  verbose = 0 
)

Definition at line 5 of file stupidheap.cpp.

Member Data Documentation

std::vector<EntryType> StupidHeap::heap
protected

Definition at line 122 of file stupidheap.h.

std::map<KeyType,PositionType> StupidHeap::heapPos
protected

Definition at line 123 of file stupidheap.h.


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