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();
96 for(
int k=0; k < eigenVeDim; ++k)
98 output.segment(k*eigenVeDim, eigenVeDim) =
99 eigenVe.row(k).transpose();
109 const T volume = (4./3.)*
M_PI*
std::pow(NN.colwise().norm().maxCoeff(), 3);
119 return T(NN.cols())/(volume);
126 const int nbEigenCol = eigenVe.cols();
128 T smallestValue(std::numeric_limits<T>::max());
129 for(
int j = 0; j < nbEigenCol ; ++j)
131 if (eigenVa(j) < smallestValue)
134 smallestValue = eigenVa(j);
138 return eigenVe.col(smallestId);
145 const int size(v.size());
148 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)