47 inline constexpr
T pow(
const T base,
const std::size_t exponent)
49 return exponent == 0 ? 1 : base *
pow(base, exponent - 1);
69 const size_t idxSize = v.size();
70 std::vector<size_t> idx(idxSize);
71 for(
size_t i=0; i < idxSize; ++i) idx[i]=i;
85 std::sort(eigenVaSort.data(), eigenVaSort.data() + eigenVaSort.size());
94 const int eigenVeDim = eigenVe.cols();
97 for (
int k = 0; k < eigenVeDim; ++k)
98 output.segment(k * eigenVeDim, eigenVeDim) = eigenVe.col(k);
107 const T volume = (4./3.)*M_PI*
std::pow(NN.colwise().norm().maxCoeff(), 3);
117 return T(NN.cols())/(volume);
124 const int nbEigenCol = eigenVe.cols();
126 T smallestValue(std::numeric_limits<T>::max());
127 for(
int j = 0; j < nbEigenCol ; ++j)
129 if (eigenVa(j) < smallestValue)
132 smallestValue = eigenVa(j);
136 return eigenVe.col(smallestId);
143 const int size(v.size());
146 for (
int i = 0; i < size; ++i)
size_t argMax(const typename PointMatcher< T >::Vector &v)
constexpr T pow(const T base, const std::size_t exponent)
PointMatcher< T >::Vector serializeEigVec(const typename PointMatcher< T >::Matrix &eigenVe)
std::vector< size_t > sortIndexes(const typename PointMatcher< T >::Vector &v)
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dense matrix over ScalarType.
IdxCompare(const typename PointMatcher< T >::Vector &target)
Functions and classes that are not dependant on scalar type are defined in this namespace.
bool operator()(size_t a, size_t b) const
PointMatcher< T >::Vector Vector
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
A vector over ScalarType.
PointMatcher< T >::Vector computeNormal(const typename PointMatcher< T >::Vector &eigenVa, const typename PointMatcher< T >::Matrix &eigenVe)
T computeDensity(const typename PointMatcher< T >::Matrix &NN)
PointMatcher< T >::Vector sortEigenValues(const typename PointMatcher< T >::Vector &eigenVa)