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
Handles.hpp
lvr2::TumbleTree::TumbleTree
TumbleTree()
lvr2::HashMap
Definition: HashMap.hpp:47
lvr2::TumbleTree::min
Cell * min()
lvr2::TumbleTree::balance
void balance()
lvr2::TumbleTree::getCellsAsVector
void getCellsAsVector(Cell *c, vector< Cell * > &cells)
lvr2::TumbleTree::makeEmpty
Cell * makeEmpty(Cell *c)
lvr2::TumbleTree::root
Cell * root
Definition: TumbleTree.hpp:27
lvr2::Cell::alpha
double alpha
Definition: TumbleTree.hpp:16
lvr2::Cell::signal_counter
double signal_counter
Definition: TumbleTree.hpp:17
lvr2::Cell::parent
Cell * parent
Definition: TumbleTree.hpp:21
NULL
#define NULL
Definition: mydefs.hpp:141
lvr2::TumbleTree::remove
Cell * remove(double sc, VertexHandle vH, Cell *c, bool removeWhole=false)
lvr2::TumbleTree::maxDepth
int maxDepth()
lvr2::TumbleTree::~TumbleTree
~TumbleTree()
lvr2::Cell::left
Cell * left
Definition: TumbleTree.hpp:19
lvr2::Cell
Definition: TumbleTree.hpp:14
lvr2::TumbleTree::minDepth
int minDepth()
lvr2::TumbleTree::sumDepth
int sumDepth(Cell *c, int currentDepth=1)
HashMap.hpp
lvr2::Cell
struct lvr2::Cell Cell
lvr2::VertexHandle
Handle to access vertices of the mesh.
Definition: Handles.hpp:146
lvr2::TumbleTree::buildTree
Cell * buildTree(vector< Cell * > &cells, int start, int end)
lvr2::TumbleTree::insert
Cell * insert(Cell *c, double sc, VertexHandle vH)
lvr2::Cell::duplicateMap
HashMap< VertexHandle, double > duplicateMap
Definition: TumbleTree.hpp:18
lvr2::TumbleTree::avgDepth
int avgDepth()
lvr2::TumbleTree::notDeleted
int notDeleted
Definition: TumbleTree.hpp:80
lvr2::TumbleTree::inorder
void inorder(Cell *c)
lvr2::TumbleTree::findMax
Cell * findMax(Cell *c)
lvr2::TumbleTree::display
void display()
lvr2::Cell::right
Cell * right
Definition: TumbleTree.hpp:20
lvr2::TumbleTree::update
void update(double alpha)
lvr2::TumbleTree::findMin
Cell * findMin(Cell *c)
lvr2::TumbleTree::numLeafes
int numLeafes(Cell *c)
lvr2::TumbleTree::makeCell
Cell * makeCell(double sc, VertexHandle vH, Cell *left=NULL, Cell *right=NULL, Cell *parent=NULL, double alpha=1)
lvr2::TumbleTree::size
int size()
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::TumbleTree::updateSC
void updateSC(double alpha)
lvr2::TumbleTree
Definition: TumbleTree.hpp:24
lvr2::TumbleTree::find
Cell * find(double sc, VertexHandle vH, Cell *c, double alpha=1)
lvr2::TumbleTree::max
Cell * max()


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 Wed Mar 2 2022 00:37:25