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>
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
static void sortByDim(LBPointArray< T > &V, int dim, LBPointArray< U > &indices, LBPointArray< T > &values)
static void mergeHostWithIndices(T *a, U *b, unsigned int i1, unsigned int j1, unsigned int i2, unsigned int j2, int limit)
static void mallocPointArray(LBPointArray< T > &m)
static void splitPointArray(LBPointArray< T > &I, LBPointArray< T > &I_L, LBPointArray< T > &I_R)
static unsigned int checkNumberOfSmallerEqualValues(LBPointArray< float > &V, unsigned int dim, float split)
unsigned int width
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)
static void copyDimensionToPointArray(LBPointArray< T > &in, int dim, LBPointArray< T > &out)
unsigned int dim
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)
static unsigned int checkNumberOfBiggerValues(LBPointArray< T > &V, unsigned int dim, T split)
static bool checkSortedIndices(const LBPointArray< T > &V, const LBPointArray< U > &sorted_indices, unsigned int dim, int n=0)
static void generatePointArray(LBPointArray< T > &m, int width, int dim)
static void naturalMergeSort(LBPointArray< T > &in, int dim, LBPointArray< U > &indices, LBPointArray< T > &m, int limit=-1)
static void fillPointArrayWithSequence(LBPointArray< T > &m)
static void generateAndSort(int id, LBPointArray< T > &vertices, LBPointArray< U > *indices_sorted, LBPointArray< T > *values_sorted, int dim)
static void copyVectorInterval(LBPointArray< T > &in, int start, int end, LBPointArray< T > &out)


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