HilbertOrder3D_Utils.hpp
Go to the documentation of this file.
1 
6 #ifndef HILBERTORDER3D_UTILS_HPP
7 #define HILBERTORDER3D_UTILS_HPP 1
8 
9 #include "Vector3D.hpp"
10 #include <vector>
11 #include <algorithm>
12 
18 int EstimateHilbertIterationNum(vector<Vector3D> const& cor);
19 
25 void AdjustPoints(vector<Vector3D> const & vPointsIn, vector<Vector3D> & vPointsOut);
26 
32 void FindEqualIndices(vector<size_t> const & vD_sorted, vector<vector<size_t> > & vOut);
33 
38 template< class T >
39 void reorder(vector<T> & v, vector<size_t> const & order)
40 {
41  vector<T> vCopy = v;
42  for (size_t ii = 0; ii < v.size(); ++ii)
43  {
44  v[ii] = vCopy[order[ii]];
45  }
46  return;
47 }
48 
49 #endif // HILBERTORDER3D_UTILS_HPP
void FindEqualIndices(vector< size_t > const &vD_sorted, vector< vector< size_t > > &vOut)
Scale a vector of 3D points to the unit-cube.
void AdjustPoints(vector< Vector3D > const &vPointsIn, vector< Vector3D > &vPointsOut)
Scale a vector of 3D points to the unit-cube.
3D Geometrical calculations
void reorder(vector< T > &v, vector< size_t > const &order)
Reorder a vector according to an index vector (obtained from the &#39;ordered&#39; function) ...
int EstimateHilbertIterationNum(vector< Vector3D > const &cor)
Estimate the number of iterations required in the Hilbert Curve, according to the number of points...