LBPointArray.hpp
Go to the documentation of this file.
1 
28 #ifndef __LBPOINTARRAY_HPP
29 #define __LBPOINTARRAY_HPP
30 
31 #include <stdlib.h>
32 #include <iostream>
33 #include <limits>
34 #include <list>
35 #include <unordered_set>
36 #include <stdlib.h>
37 
38 namespace lvr2
39 {
40 
41 template<typename T>
42 struct LBPointArray {
43  unsigned int width;
44  unsigned int dim;
46 };
47 
48 // static helper methods
49 
50 template<typename T>
51 static void mallocPointArray(LBPointArray<T>& m);
52 
53 template<typename T>
54 static void generatePointArray(LBPointArray<T>& m, int width, int dim);
55 
56 template<typename T>
57 static void generatePointArray(int id, LBPointArray<T>& m, int width, int dim);
58 
59 template<typename T>
61 
62 // Pool function
63 template<typename T>
64 static void fillPointArrayWithSequence(int id, LBPointArray<T>& m);
65 
66 template<typename T>
67 static void copyVectorInterval(LBPointArray<T>& in, int start, int end, LBPointArray<T>& out);
68 
69 template<typename T>
70 static void copyDimensionToPointArray(LBPointArray<T>& in, int dim, LBPointArray<T>& out);
71 
72 template<typename T>
74 
75 template<typename T, typename U>
76 static bool checkSortedIndices(const LBPointArray<T>& V,
77  const LBPointArray<U>& sorted_indices,
78  unsigned int dim,
79  int n=0);
80 
81 
82 template<typename T, typename U>
83 static void splitPointArrayWithValue(const LBPointArray<T>& V,
84  const LBPointArray<U>& I, LBPointArray<U>& I_L, LBPointArray<U>& I_R,
85  int current_dim, T value,
86  T& deviation_left, T& deviation_right, const unsigned int& orig_dim,
87  const std::list<U>& critical_indices_left, const std::list<U>& critical_indices_right);
88 
89 template<typename T, typename U>
90 static void splitPointArrayWithValueSet(const LBPointArray<T>& V,
91  const LBPointArray<U>& I, LBPointArray<U>& I_L, LBPointArray<U>& I_R,
92  int current_dim, T value,
93  T& deviation_left, T& deviation_right, const unsigned int& orig_dim,
94  const std::unordered_set<U>& critical_indices_left,
95  const std::unordered_set<U>& critical_indices_right);
96 
97 
98 template<typename T>
99 static unsigned int checkNumberOfBiggerValues(LBPointArray<T>& V, unsigned int dim, T split);
100 
101 static unsigned int checkNumberOfSmallerEqualValues(LBPointArray<float>& V, unsigned int dim, float split);
102 
103 
104 // SORT FUNCTIONS THREADED
105 template<typename T, typename U>
106 static void mergeHostWithIndices(T* a, U* b, unsigned int i1, unsigned int j1,
107  unsigned int i2, unsigned int j2, int limit);
108 
109 template<typename T, typename U>
110 static void naturalMergeSort(LBPointArray<T>& in, int dim, LBPointArray<U>& indices, LBPointArray<T>& m, int limit=-1);
111 
112 template<typename T, typename U>
113 static void sortByDim(LBPointArray<T>& V, int dim, LBPointArray<U>& indices, LBPointArray<T>& values);
114 
115 template<typename T, typename U>
116 static void generateAndSort(int id, LBPointArray<T>& vertices, LBPointArray<U>* indices_sorted,
117  LBPointArray<T>* values_sorted, int dim);
118 
119 } /* namespace lvr2 */
120 
121 #include "LBPointArray.tcc"
122 
123 #endif // !__POINTARRAY_HPP
lvr2::generatePointArray
static void generatePointArray(LBPointArray< T > &m, int width, int dim)
lvr2::mallocPointArray
static void mallocPointArray(LBPointArray< T > &m)
lvr2::splitPointArrayWithValueSet
static void splitPointArrayWithValueSet(const LBPointArray< T > &V, const LBPointArray< U > &I, LBPointArray< U > &I_L, LBPointArray< U > &I_R, int current_dim, T value, T &deviation_left, T &deviation_right, const unsigned int &orig_dim, const std::unordered_set< U > &critical_indices_left, const std::unordered_set< U > &critical_indices_right)
lvr2::copyDimensionToPointArray
static void copyDimensionToPointArray(LBPointArray< T > &in, int dim, LBPointArray< T > &out)
lvr2::LBPointArray::elements
T * elements
Definition: LBPointArray.hpp:45
lvr2::checkNumberOfBiggerValues
static unsigned int checkNumberOfBiggerValues(LBPointArray< T > &V, unsigned int dim, T split)
lvr2::LBPointArray::dim
unsigned int dim
Definition: LBPointArray.hpp:44
lvr2::checkNumberOfSmallerEqualValues
static unsigned int checkNumberOfSmallerEqualValues(LBPointArray< float > &V, unsigned int dim, float split)
lvr2::copyVectorInterval
static void copyVectorInterval(LBPointArray< T > &in, int start, int end, LBPointArray< T > &out)
lvr2::generateAndSort
static void generateAndSort(int id, LBPointArray< T > &vertices, LBPointArray< U > *indices_sorted, LBPointArray< T > *values_sorted, int dim)
lvr2::fillPointArrayWithSequence
static void fillPointArrayWithSequence(LBPointArray< T > &m)
lvr2::naturalMergeSort
static void naturalMergeSort(LBPointArray< T > &in, int dim, LBPointArray< U > &indices, LBPointArray< T > &m, int limit=-1)
scripts.create_png.values
values
Definition: create_png.py:26
lvr2::sortByDim
static void sortByDim(LBPointArray< T > &V, int dim, LBPointArray< U > &indices, LBPointArray< T > &values)
lvr2::mergeHostWithIndices
static void mergeHostWithIndices(T *a, U *b, unsigned int i1, unsigned int j1, unsigned int i2, unsigned int j2, int limit)
lvr2::checkSortedIndices
static bool checkSortedIndices(const LBPointArray< T > &V, const LBPointArray< U > &sorted_indices, unsigned int dim, int n=0)
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::LBPointArray::width
unsigned int width
Definition: LBPointArray.hpp:43
lvr2::splitPointArray
static void splitPointArray(LBPointArray< T > &I, LBPointArray< T > &I_L, LBPointArray< T > &I_R)
lvr2::LBPointArray
Definition: LBPointArray.hpp:42
lvr2::splitPointArrayWithValue
static void splitPointArrayWithValue(const LBPointArray< T > &V, const LBPointArray< U > &I, LBPointArray< U > &I_L, LBPointArray< U > &I_R, int current_dim, T value, T &deviation_left, T &deviation_right, const unsigned int &orig_dim, const std::list< U > &critical_indices_left, const std::list< U > &critical_indices_right)


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:24