HOG2
|
A simple & efficient Heap class which uses Graph objects. More...
#include <Heap.h>
Public Member Functions | |
Heap (int s=DEFAULT_SIZE) | |
~Heap () | |
unsigned int | size () |
void | Add (graph_object *val) |
Add object into Heap. More... | |
void | DecreaseKey (graph_object *val) |
Indicate that the key for a particular object has decreased. More... | |
bool | IsIn (graph_object *val) |
Returns true if the object is in the Heap. More... | |
graph_object * | Remove () |
Remove the item with the lowest key from the Heap & re-heapify. More... | |
bool | Empty () |
Returns true if no items are in the Heap. More... | |
Private Member Functions | |
void | HeapifyUp (int index) |
void | HeapifyDown (int index) |
Private Attributes | |
std::vector< graph_object * > | _elts |
int | count |
Heap::Heap | ( | int | s = DEFAULT_SIZE | ) |
void Heap::Add | ( | graph_object * | val | ) |
Add object into Heap.
Definition at line 36 of file Heap.cpp.
References _elts, count, HeapifyUp(), and graph_object::key.
Referenced by praStar::astar(), GraphMapInconsistentHeuristic::FillInCache(), GraphDistanceHeuristic::FindFarNode(), corridorAStar::getBestPath(), GraphDistanceHeuristic::GetOptimalDistances(), and aStarOld::GetPath().
void Heap::DecreaseKey | ( | graph_object * | val | ) |
Indicate that the key for a particular object has decreased.
Definition at line 47 of file Heap.cpp.
References HeapifyUp(), and graph_object::key.
Referenced by GraphMapInconsistentHeuristic::FillInCache(), GraphDistanceHeuristic::FindFarNode(), GraphDistanceHeuristic::GetOptimalDistances(), aStarOld::relaxEdge(), corridorAStar::relaxEdge(), praStar::relaxEdge(), corridorAStar::relaxFinalEdge(), and corridorAStar::relaxFirstEdge().
bool Heap::Empty | ( | ) |
Returns true if no items are in the Heap.
Definition at line 83 of file Heap.cpp.
References count.
Referenced by GraphMapInconsistentHeuristic::FillInCache(), GraphDistanceHeuristic::FindFarNode(), GraphDistanceHeuristic::GetOptimalDistances(), and Remove().
|
private |
|
private |
Definition at line 88 of file Heap.cpp.
References _elts, and fgreater().
Referenced by Add(), and DecreaseKey().
bool Heap::IsIn | ( | graph_object * | val | ) |
Returns true if the object is in the Heap.
Definition at line 55 of file Heap.cpp.
References _elts, and graph_object::key.
Referenced by praStar::astar(), GraphMapInconsistentHeuristic::FillInCache(), GraphDistanceHeuristic::FindFarNode(), corridorAStar::getBestPath(), GraphDistanceHeuristic::GetOptimalDistances(), and aStarOld::GetPath().
graph_object * Heap::Remove | ( | ) |
Remove the item with the lowest key from the Heap & re-heapify.
Definition at line 66 of file Heap.cpp.
References _elts, count, Empty(), and HeapifyDown().
Referenced by praStar::astar(), GraphMapInconsistentHeuristic::FillInCache(), GraphDistanceHeuristic::FindFarNode(), corridorAStar::getBestPath(), GraphDistanceHeuristic::GetOptimalDistances(), and aStarOld::GetPath().
|
private |
Definition at line 40 of file Heap.h.
Referenced by Add(), Heap(), HeapifyDown(), HeapifyUp(), IsIn(), Remove(), and size().
|
private |