10#include "../defines.h"
25 template <
class DataPo
int,
class _NFilter,
typename T =
void>
29 using Scalar =
typename DataPoint::Scalar;
32 using NeighborFrame =
typename NeighborFilter::NeighborhoodFrame;
53 PONCA_FITTING_APIDOC_SETWFUNC
56 PONCA_FITTING_APIDOC_INIT
57 PONCA_MULTIARCH
inline void init()
95 PONCA_MULTIARCH
inline NeighborFrame& getNeighborFrame() {
return m_nFilter.frame(); }
96 PONCA_MULTIARCH
inline const NeighborFrame& getNeighborFrame()
const {
return m_nFilter.frame(); }
102 PONCA_FITTING_APIDOC_ADDNEIGHBOR
109 PONCA_FITTING_APIDOC_FINALIZE
113 if (m_sumW ==
Scalar(0.) || m_nbNeighbors < 1)
140 template <
class DataPo
int,
class _NFilter,
int Type,
typename T>
141 requires ProvidesBasketUnitBase<T>
144 PONCA_FITTING_DECLARE_DEFAULT_TYPES
145 PONCA_FITTING_DECLARE_MATRIX_TYPE
147 static constexpr int NbDerivatives =
153 using VectorArray = Eigen::Matrix<Scalar, DataPoint::Dim, NbDerivatives, DerStorageOrder>;
167 PONCA_MULTIARCH
inline void init()
Base class of any computation unit of a BasketDiff.
Eigen::Matrix< Scalar, DataPoint::Dim, NbDerivatives, DerStorageOrder > VectorArray
Static array of scalars with a size adapted to the differentiation type.
void addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes, ScalarArray &dw)
static constexpr bool isSpaceDer()
State specified at compilation time to compute derivatives in space.
static constexpr bool isScaleDer()
State specified at compilation time to compute derivatives in scale.
typename DataPoint::Scalar Scalar
Alias to scalar type.
typename Base::VectorType VectorType
Alias to vector type.
Eigen::Matrix< Scalar, 1, NbDerivatives > ScalarArray
Static array of scalars with a size adapted to the differentiation type.
ScalarArray m_dSumW
Sum of weight derivatives.
static constexpr unsigned int derDimension()
Number of dimensions used for the differentiation.
Base class of any computation unit of a Basket.
Scalar getWeightSum() const
Get the sum of the weights.
int getNumNeighbors() const
Get number of points added in the neighborhood (with positive weight)
void setNeighborFilter(const NeighborFilter &_nFilter)
Init the WeightFunc, without changing the other internal states.
FIT_RESULT finalize()
Finalize the procedure.
bool isStable() const
Is the fitted primitive ready to use (finalize has been called and the result is stable)
void addLocalNeighbor(Scalar w, const VectorType &, const DataPoint &)
Add a neighbor to perform the fit.
const NeighborFilter & getNeighborFilter() const
Read access to the NeighborFilter.
void init()
Set the evaluation position and reset the internal states.
bool needAnotherPass() const
Is another pass required for fitting (finalize has been called and the result is NEED_OTHER_PASS)
typename DataPoint::VectorType VectorType
Inherited vector type.
NeighborFilter m_nFilter
Neighborhood filter.
FIT_RESULT getCurrentState() const
void startNewPass()
To be called when starting a new processing pass, ie.
bool isReady() const
Is the primitive well-fitted and ready to use (finalize has been called) ?
typename DataPoint::Scalar Scalar
Inherited scalar type.
FIT_RESULT m_eCurrentState
Represent the current state of the fit (finalize function update the state)
Aggregator class used to declare specialized structures using CRTP.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
@ FitSpaceDer
Flag indicating a space differentiation.
@ FitScaleDer
Flag indicating a scale differentiation.
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.
@ NEED_OTHER_PASS
The fitting procedure needs to analyse the neighborhood another time.
@ 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...