TumbleTree.hpp
Go to the documentation of this file.
1 //
2 // Created by patrick on 4/4/19.
3 //
4 
5 #ifndef LAS_VEGAS_TUMBLETREE_HPP
6 #define LAS_VEGAS_TUMBLETREE_HPP
7 
10 
11 namespace lvr2
12 {
13 
14 typedef struct Cell
15 {
16  double alpha = 1;
19  Cell* left; // left subtree
20  Cell* right; // right subtree
22 } Cell;
23 
25 {
26 
28 
29  Cell* makeEmpty(Cell* c);
30 
31  Cell* remove(double sc, VertexHandle vH, Cell* c, bool removeWhole = false);
32  // Cell* removeTwo(double sc, VertexHandle vH, Cell* c, bool removeWhole = false, double alpha =
33  // 1);
34 
35  Cell* insert(Cell* c, double sc, VertexHandle vH);
36  Cell* findMin(Cell* c);
37  Cell* findMax(Cell* c);
38  Cell* find(double sc, VertexHandle vH, Cell* c, double alpha = 1);
39  int size(Cell* c);
40  int maxDepth(Cell* cell);
41  int minDepth(Cell* cell);
42  int sumDepth(Cell* c, int currentDepth = 1);
43  int numLeafes(Cell* c);
44  Cell* buildTree(vector<Cell*>& cells, int start, int end);
45  void getCellsAsVector(Cell* c, vector<Cell*>& cells);
46 
47  void update(double alpha);
48 
49  void inorder(Cell* c);
50 
51  public:
52  TumbleTree();
53  ~TumbleTree();
54 
55  // Cell* insertIterative(double sc, VertexHandle vH);
56  Cell* insert(double sc, VertexHandle vH);
57  double remove(Cell* c, VertexHandle vH); // returns the real sc
58 
59  int maxDepth();
60  int minDepth();
61  int avgDepth();
62  Cell* find(double sc, VertexHandle vH);
63 
64  void display();
65  void balance();
66 
67  Cell* min();
68  Cell* max();
69 
70  Cell* makeCell(double sc,
71  VertexHandle vH,
72  Cell* left = NULL,
73  Cell* right = NULL,
74  Cell* parent = NULL,
75  double alpha = 1);
76 
77  int size();
78 
79  void updateSC(double alpha);
80  int notDeleted = 0;
81 };
82 
83 } // namespace lvr2
84 
85 #include "TumbleTree.tcc"
86 
87 #endif // LAS_VEGAS_TUMBLETREE_HPP
Cell * left
Definition: TumbleTree.hpp:19
Handle to access vertices of the mesh.
Definition: Handles.hpp:146
struct lvr2::Cell Cell
double alpha
Definition: TumbleTree.hpp:16
double signal_counter
Definition: TumbleTree.hpp:17
HashMap< VertexHandle, double > duplicateMap
Definition: TumbleTree.hpp:18
#define NULL
Definition: mydefs.hpp:141
Cell * right
Definition: TumbleTree.hpp:20
Cell * parent
Definition: TumbleTree.hpp:21


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:09