OOFEM 3.0
Loading...
Searching...
No Matches
heap.h
Go to the documentation of this file.
1#ifndef heap_h
2#define heap_h
3
4namespace oofem {
11
12class Heap
13{
14public:
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
41private:
44
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
#define N(a, b)
int lastParentInd()
Definition heap.C:56
double * Keys
Definition heap.h:23
void swapElements(int Ind1, int Ind2)
Definition heap.C:63
void update(double time, int Ind)
Definition heap.C:167
int checkHeapProperty(int pInd)
Debugging tools.
Definition heap.C:196
double getSmallest(int *Ind)
Definition heap.C:176
int parentInd(int inInd)
Index calculations.
Definition heap.C:44
void downHeap(int Ind)
Definition heap.C:102
int * T2H
Definition heap.h:25
void printTree()
Definition heap.C:250
~Heap()
Definition heap.C:30
double * formMatrix(int m, int n)
Definition heap.C:269
void print()
Definition heap.C:217
int * H2T
Definition heap.h:24
int nElems()
Definition heap.C:142
void upHeap(int Ind)
Elementary heap operations.
Definition heap.C:87
int heapCount
Keeps track of the number of elements in heap.
Definition heap.h:46
void insert(double time, int Ind)
Definition heap.C:146
Heap(int N)
Constructor and destructor.
Definition heap.C:9
int Initial_Heap_Alloc_Size
Variables that control the memory allocation for the heap.
Definition heap.h:43
int leftChildInd(int inInd)
Definition heap.C:48
bool isInHeap(int Ind)
Definition heap.C:136
int rightChildInd(int inInd)
Definition heap.C:52
void recurse(int row, int pad, int spacing, int S)
Used by printTree. Does the actual printing, top-down.
Definition heap.C:224
int allocatedSize
Definition heap.h:43
void setToEmpty(int N)
Interface with external algorithms (such as fast marching).
Definition heap.C:37
#define S(p)
Definition mdm.C:469

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011