SpherePackingScenarioGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Heap.h
Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 // Event Heap maker
00003 //---------------------------------------------------------------------------
00004 
00005 #ifndef  LS2_HEAP_H
00006 #define  LS2_HEAP_H
00007 
00008 #include "Event.h"
00009 #include "Sphere.h"
00010 namespace algorithms{
00011 namespace ls2{
00012 class Heap;
00013 }
00014 }
00018 class algorithms::ls2::Heap {
00019 
00020 public:
00021 
00025         Heap(int maxsize);
00029         Heap(const Heap &h);
00033         ~Heap();
00034 
00038         void upHeap(int k);
00042         void downHeap(int k);
00046         void insert(int i);
00050         void replace(int i);
00054         int search(int j);
00058         void change(int i);
00062         int extractmax();
00066         void print();
00070         void checkindex();
00071 //by Tan
00072         Sphere *getSphere();
00073 
00074         void setSphere(Sphere *s);
00075 
00076         int getIndex(int j);
00077 
00078 private:
00082                 int maxsize;
00086                 int N;
00090                 int *a;
00094                 Sphere *s;
00098                 int *index;
00099                 //event minevent;
00100 
00101 };
00102 #endif 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines