34 #if defined(CompareLocalEstimators_RECURSES)
35 #error Recursive header files inclusion detected in CompareLocalEstimators.h
36 #else // defined(CompareLocalEstimators_RECURSES)
38 #define CompareLocalEstimators_RECURSES
40 #if !defined CompareLocalEstimators_h
42 #define CompareLocalEstimators_h
48 #include "DGtal/base/Common.h"
49 #include "DGtal/base/Statistic.h"
65 template <
typename TFirstEsimator,
typename TSecondEstimator>
76 typedef typename FirstEstimator::Quantity
Quantity;
105 ASSERT( aFirstEstimator.isValid());
106 ASSERT( aSecondEstimator.isValid());
108 return aFirstEstimator.eval(it) - aSecondEstimator.eval(it);
133 const bool storeSamples =
false)
165 ASSERT( aFirstEstimator.isValid());
166 ASSERT( aSecondEstimator.isValid());
167 Quantity v1 = aFirstEstimator.eval(it), v2 = aSecondEstimator.eval(it);
169 ASSERT( v1.norm() != 0.0 );
170 ASSERT( v2.norm() != 0.0 );
171 double ndot = (double) v1.dot(v2)
172 / ( (double) ( v1.norm() * v2.norm() ) );
173 return ( ndot > 1.0 ) ? 0.0
174 : ( ndot < -1.0 ) ?
M_PI : acos( ndot );
200 const bool storeSamples =
false)
237 #endif // !defined CompareLocalEstimators_h
239 #undef CompareLocalEstimators_RECURSES
240 #endif // else defined(CompareLocalEstimators_RECURSES)