34#if defined(CompareLocalEstimators_RECURSES)
35#error Recursive header files inclusion detected in CompareLocalEstimators.h
38#define CompareLocalEstimators_RECURSES
40#if !defined CompareLocalEstimators_h
42#define CompareLocalEstimators_h
48#include "DGtal/base/Common.h"
49#include "DGtal/math/Statistic.h"
65 template <
typename TFirstEsimator,
typename TSecondEstimator>
76 typedef typename FirstEstimator::Quantity
Quantity;
107 ASSERT( aFirstEstimator.isValid() );
108 ASSERT( aSecondEstimator.isValid( ));
110 return aFirstEstimator.eval(it, h) - aSecondEstimator.eval(it, h);
137 const bool storeSamples =
false)
171 ASSERT( aFirstEstimator.isValid());
172 ASSERT( aSecondEstimator.isValid());
173 Quantity v1 = aFirstEstimator.eval(it, h), v2 = aSecondEstimator.eval(it, h);
175 ASSERT( v1.norm() != 0.0 );
176 ASSERT( v2.norm() != 0.0 );
177 double ndot = (double) v1.dot(v2)
178 / ( (double) ( v1.norm() * v2.norm() ) );
179 return ( ndot > 1.0 ) ? 0.0
180 : ( ndot < -1.0 ) ? M_PI : acos( ndot );
207 const bool storeSamples =
false)
246#undef CompareLocalEstimators_RECURSES
Aim: This class processes a set of sample values for one variable and can then compute different stat...
void addValue(Quantity v)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Functor to compare two local geometric estimators.
static OutputStatistic compare(FirstEstimator &aFirstEstimator, SecondEstimator &aSecondEstimator, const ConstIterator &itb, const ConstIterator &ite, const double h=1., const bool storeSamples=false)
static OutputVectorStatistic compareVectors(FirstEstimator &aFirstEstimator, SecondEstimator &aSecondEstimator, const ConstIterator &itb, const ConstIterator &ite, const double h, const bool storeSamples=false)
TSecondEstimator SecondEstimator
Statistic< double > OutputVectorStatistic
static double compareVectors(FirstEstimator &aFirstEstimator, SecondEstimator &aSecondEstimator, const ConstIterator &it, const double h=1.)
CompareLocalEstimators & operator=(const CompareLocalEstimators &other)
TFirstEsimator FirstEstimator
Statistic< Quantity > OutputStatistic
Output statistic type.
FirstEstimator::Quantity Quantity
static Quantity compare(FirstEstimator &aFirstEstimator, SecondEstimator &aSecondEstimator, const ConstIterator &it, const double h=1.)
CompareLocalEstimators(const CompareLocalEstimators &other)
FirstEstimator::ConstIterator ConstIterator