7template <
class DataPo
int,
class _NFilter,
typename T>
14template <
class DataPo
int,
class _NFilter,
typename T>
23 a(DataPoint::Dim + 1) =
localQ.squaredNorm();
27 m_matA +=
w *
a *
a.transpose();
30template <
class DataPo
int,
class _NFilter,
typename T>
34 if (Base::finalize() !=
STABLE)
35 return Base::m_eCurrentState;
36 if (Base::getNumNeighbors() < DataPoint::Dim)
38 if (Base::algebraicSphere().isValid())
41 Base::m_eCurrentState = Base::getNumNeighbors() < 2 * DataPoint::Dim ?
UNSTABLE :
STABLE;
64 m_solver.computeDirect(
invCpratt * m_matA);
68 VectorA
eivals = m_solver.eigenvalues().real();
70 for (
int i = 0;
i < DataPoint::Dim + 2; ++
i)
78 VectorA
vecU = m_solver.eigenvectors().col(
minId).real();
79 Base::m_uq =
vecU[1 + DataPoint::Dim];
83 Base::m_isNormalized =
false;
85 return Base::m_eCurrentState;
Aggregator class used to declare specialized structures using CRTP.
Algebraic Sphere fitting procedure on point set without normals.
typename DataPoint::Scalar Scalar
Alias to scalar type.
typename Base::VectorType VectorType
Alias to vector type.
FIT_RESULT
Enum corresponding to the state of a fitting method (and what the finalize function returns)
@ UNDEFINED
The fitting is undefined, you can't use it for valid results.
@ CONFLICT_ERROR_FOUND
Multiple classes of the fitting procedure initialize the primitive.
@ STABLE
The fitting is stable and ready to use.
@ UNSTABLE
The fitting is ready to use but it is considered as unstable (if the number of neighbors is low for e...
FIT_RESULT compute(const IteratorBegin &begin, const IteratorEnd &end)
Convenience function for STL-like iterators Add neighbors stored in a container using STL-like iterat...