8#include "../concepts.h"
9#include "../Filters/concepts.h"
10#include "../Basket/concepts.h"
11#include "../defines.h"
28 template <
typename Scalar>
48 template <
typename ComputeObject,
typename ItB,
typename ItE,
typename Project = DirectProjectionOperator>
50 const Project& _p = Project{})
const
52 return computeMLSImpl(_co, [&]() {
return _co.
compute(_itb, _ite); }, _p);
68 template <
typename ComputeObject,
typename Po
intContainer,
typename Project = DirectProjectionOperator>
70 const Project& _p = Project{})
72 return compute(_co, std::begin(container), std::end(container), _p);
90 template <
typename ComputeObject,
typename IdxRange,
typename PointContainer,
91 typename Project = DirectProjectionOperator>
93 const PointContainer& _container,
94 const Project& _p = Project{})
const
96 return computeMLSImpl(_co, [&]() {
return _co.
computeWithIds(_range, _container); }, _p);
100 static constexpr Scalar
epsDefault = Eigen::NumTraits<Scalar>::dummy_precision();
124 template <
typename ComputeObject,
typename Func,
typename Project = DirectProjectionOperator>
128 const Project& _p = Project{})
const
131 auto& frame = _co.getNeighborFrame();
132 auto lastPos = frame.center();
134 for (
unsigned int mm = 0; mm <
nIter; ++mm)
136 frame.changeNeighborhoodFrame(lastPos);
141 auto newPos = _p(_co, lastPos);
142 if (newPos.isApprox(lastPos,
eps))
This concept ensures that the default types and accessors in a Basket are well-formed.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
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.
ComputeObject is a virtual object that represents an algorithm which can be used with the compute fun...
FIT_RESULT computeWithIds(IndexRange, const PointContainer &)
Convenience function to iterate over a subset of samples in a PointContainer.
FIT_RESULT compute(const Container &c)
Convenience function for STL-like container.
Computes the fit using the Moving Least Squares approach.
Scalar eps
Epsilon value for stopping MLS iterations.
static constexpr int nIterDefault
Default maximum number of MLS iterations.
unsigned int nIter
Maximum number of MLS iterations.
static constexpr Scalar epsDefault
Default epsilon value for stopping MLS iterations.
FIT_RESULT computeWithIds(ComputeObject &_co, const IdxRange &_range, const PointContainer &_container, const Project &_p=Project{}) const
Computes the fit using the MLS iteration process.
FIT_RESULT compute(ComputeObject &_co, const ItB &_itb, const ItE &_ite, const Project &_p=Project{}) const
Computes the fit using the MLS iteration process.
FIT_RESULT compute(ComputeObject &_co, const PointContainer &container, const Project &_p=Project{})
Computes the fit using the MLS iteration process.