11#include "../../defines.h"
12#include "../concepts.h"
14#include PONCA_MULTIARCH_INCLUDE_STD(cmath)
15#include PONCA_MULTIARCH_INCLUDE_CU_STD(limits)
19#define COVARIANCE_FIT_BASE_REQUIREMENTS ProvidesMeanPosition<T>
20#define COVARIANCE_FIT_DER_REQUIREMENTS \
21 ProvidesBasketDiffUnitBase<T>&& ProvidesMeanPositionDerivative<T>&& ProvidesPositionCovariance<T>
63 template <
class DataPo
int,
class _NFilter,
typename T>
64 requires COVARIANCE_FIT_BASE_REQUIREMENTS
67 PONCA_FITTING_DECLARE_DEFAULT_TYPES
71 using Solver = Eigen::SelfAdjointEigenSolver<MatrixType>;
80 PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE
140 return Base::operator==(other) && internal::isApprox(
m_cov, other.
m_cov);
149 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
150 requires COVARIANCE_FIT_DER_REQUIREMENTS
151 class CovarianceDer :
public T
153 PONCA_FITTING_DECLARE_DEFAULT_TYPES
154 PONCA_FITTING_DECLARE_MATRIX_TYPE
155 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
161 PONCA_MULTIARCH CovarianceDer()
163 for (
int k = 0; k < Base::NbDerivatives; ++k)
168 PONCA_FITTING_DECLARE_INIT_ADDDER_FINALIZE
170 PONCA_MULTIARCH
inline bool operator==(
const CovarianceDer<DataPoint, NeighborFilter, DiffType, T>& other)
const
172 bool equal = Base::operator==(other);
173 for (
size_t i = 0; equal && (i < Base::NbDerivatives); ++i)
174 equal = equal && internal::isApprox(
m_dCov[i], other.
m_dCov[i]);
179#include "covariance.hpp"
Procedure that compute and decompose the covariance matrix of the neighbors positions.
CovarianceBase< DataPoint, _NFilter, T > & covarianceBase()
Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
Scalar lambda_1() const
The second eigenvalue .
Eigen::SelfAdjointEigenSolver< MatrixType > Solver
Solver used to analyse the covariance matrix.
Scalar surfaceVariation() const
Implements pauly:2002:pssimplification surface variation.
MatrixType m_cov
Covariance matrix.
Scalar planarity() const
Implements the planarity guinard:2017 .
Scalar sphericity() const
Implements the sphericity guinard:2017 .
typename DataPoint::MatrixType MatrixType
Alias to matrix type.
Scalar lambda_0() const
The minimum eigenvalue .
typename DataPoint::Scalar Scalar
Alias to scalar type.
Scalar anisotropy() const
Implements the anisotropy guinard:2017 .
Solver m_solver
Solver used to analyse the covariance matrix.
Scalar linearity() const
Implements the linearity guinard:2017 .
Scalar eigenentropy() const
Implements the eigenentropy guinard:2017 .
const Solver & solver() const
Reading access to the Solver used to analyze the covariance matrix.
Scalar lambda_2() const
The maximum eigenvalue .
typename DataPoint::MatrixType MatrixType
Alias to matrix type.
CovarianceDer< DataPoint, _NFilter, DiffType, T > & covarianceDer()
Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
MatrixType m_dCov[Base::NbDerivatives]
Computation data: derivatives of the covariance matrix.
typename DataPoint::Scalar Scalar
Alias to scalar type.
This Source Code Form is subject to the terms of the Mozilla Public License, v.