OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
heap.h
Go to the documentation of this file.
1 #ifndef heap_h
2 #define heap_h
3 
4 namespace oofem {
12 class Heap
13 {
14 public:
16  Heap(int N);
17  ~Heap();
18 
23  double *Keys;
24  int *H2T;
25  int *T2H;
26 
28  void setToEmpty(int N);
29  bool isInHeap(int Ind);
30  int nElems();
31  void insert(double time, int Ind);
32  void update(double time, int Ind);
33  double getSmallest(int *Ind);
34 
36  int checkHeapProperty(int pInd);
37  void print();
38  void printTree();
39  double *formMatrix(int m, int n);
40 
41 private:
44 
46  int heapCount;
47 
49  void upHeap(int Ind);
50  void downHeap(int Ind);
51  void swapElements(int Ind1, int Ind2);
52 
54  int parentInd(int inInd);
55  int leftChildInd(int inInd);
56  int rightChildInd(int inInd);
57  int lastParentInd();
58 
60  void recurse(int row, int pad, int spacing, int S);
61 };
62 } // end namespace oofem
63 #endif // heap_h
double getSmallest(int *Ind)
Definition: heap.C:176
void swapElements(int Ind1, int Ind2)
Definition: heap.C:63
void print()
Definition: heap.C:217
int * T2H
Definition: heap.h:25
~Heap()
Definition: heap.C:30
void recurse(int row, int pad, int spacing, int S)
Used by printTree. Does the actual printing, top-down.
Definition: heap.C:224
#define S(p)
Definition: mdm.C:481
int checkHeapProperty(int pInd)
Debugging tools.
Definition: heap.C:196
void insert(double time, int Ind)
Definition: heap.C:146
void upHeap(int Ind)
Elementary heap operations.
Definition: heap.C:87
int * H2T
Definition: heap.h:24
int lastParentInd()
Definition: heap.C:56
Class implementing a heap, which is an auxiliary data structure used for efficient sorting and exploi...
Definition: heap.h:12
int heapCount
Keeps track of the number of elements in heap.
Definition: heap.h:46
#define N(p, q)
Definition: mdm.C:367
double * Keys
Heap arrays: Keys contains certain real values that need to be sorted.
Definition: heap.h:23
void downHeap(int Ind)
Definition: heap.C:102
void setToEmpty(int N)
Interface with external algorithms (such as fast marching)
Definition: heap.C:37
int leftChildInd(int inInd)
Definition: heap.C:48
int parentInd(int inInd)
Index calculations.
Definition: heap.C:44
bool isInHeap(int Ind)
Definition: heap.C:136
int rightChildInd(int inInd)
Definition: heap.C:52
int allocatedSize
Definition: heap.h:43
int nElems()
Definition: heap.C:142
void update(double time, int Ind)
Definition: heap.C:167
double * formMatrix(int m, int n)
Definition: heap.C:269
int Initial_Heap_Alloc_Size
Variables that control the memory allocation for the heap.
Definition: heap.h:43
void printTree()
Definition: heap.C:250
the oofem namespace is to define a context or scope in which all oofem names are defined.
Heap(int N)
Constructor and destructor.
Definition: heap.C:9

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011