box_heap.h
Go to the documentation of this file.
1 #ifndef BOX_HEAPH
2 #define BOX_HEAPH
3 
4 #include "heap.h"
5 #include "box_list.h"
6 #include "box.h"
7 #include "boolean.h"
8 
9 
27 #define INIT_NUM_BOXES_IN_HEAP 100
28 
42 void InitHeapOfBoxes(boolean (* LessThan)(void *,void*,void*),void *userData,Theap *h);
43 
44 
45 
55 void AddBox2HeapOfBoxes(Tbox *b,Theap *h);
56 
69 double HeapOfBoxesVolume(boolean *used,Theap *h);
70 
83 double HeapOfBoxesMaxDiagonal(boolean *used,Theap *h);
84 
85 
98 double HeapOfBoxesMaxSize(boolean *used,Theap *h);
99 
112 void Heap2List(Tlist *l,Theap *h);
113 
124 void AddList2Heap(Tlist *l,Theap *h);
125 
126 
145 void PrintHeapOfBoxes(FILE *f,boolean *used,char *heading,Theap *h);
146 
147 #endif
Definition of the boolean type.
void AddBox2HeapOfBoxes(Tbox *b, Theap *h)
Adds a box to a heap of boxes.
Definition: box_heap.c:26
void InitHeapOfBoxes(boolean(*LessThan)(void *, void *, void *), void *userData, Theap *h)
Constructor.
Definition: box_heap.c:21
void Heap2List(Tlist *l, Theap *h)
Converts a heap of boxes into a list.
Definition: box_heap.c:82
double HeapOfBoxesMaxSize(boolean *used, Theap *h)
Computes the maximum size for all boxes in a heap.
Definition: box_heap.c:63
void AddList2Heap(Tlist *l, Theap *h)
Adds a list of boxes into a heap.
Definition: box_heap.c:97
Collection of methods to work on Tlist of boxes.
Definition of a binary heap used to implement priority queues.
Definition of the Tbox type and the associated functions.
A generic list.
Definition: list.h:46
double HeapOfBoxesVolume(boolean *used, Theap *h)
Computes the volume of a heap.
Definition: box_heap.c:31
A box.
Definition: box.h:83
A generic binary heap.
Definition: heap.h:105
double HeapOfBoxesMaxDiagonal(boolean *used, Theap *h)
Computes the maximum diagonal for all boxes in a heap.
Definition: box_heap.c:45
void PrintHeapOfBoxes(FILE *f, boolean *used, char *heading, Theap *h)
Prints a heap of boxes.
Definition: box_heap.c:110