29 #if defined(FunctorsLambdaMST_RECURSES)
30 #error Recursive header files inclusion detected in FunctorsLambdaMST.h
31 #else // defined(FunctorsLambdaMST_RECURSES)
33 #define FunctorsLambdaMST_RECURSES
35 #if !defined FunctorsLambdaMST_h
37 #define FunctorsLambdaMST_h
42 #include "DGtal/base/Common.h"
43 #include "DGtal/base/CUnaryFunctor.h"
71 return 64.0 * ( -e3 * e3 + 3.0 * e3 * e2 - 3.0 * e2 * e2 + e3 );
83 return std::sin ( M_PI * x );
96 return 2.0 / ( std::exp ( 15.0 * ( x - 0.5 ) ) + std::exp ( -15.0 * ( x - 0.5 ) ) );
108 template<
typename DSS,
typename LambdaFunction>
124 this->first += ch.
first;
125 this->second += ch.
second;
140 Value operator() (
const TDSS& aDSS,
const int & indexOfPointInDSS,
const int & dssLen )
const
143 double norm = std::sqrt ( aDSS.a() * aDSS.a() + aDSS.b() * aDSS.b() );
145 result.
first[0] = result.
second * aDSS.b () / norm;
146 result.
first[1] = result.
second * aDSS.a () / norm;
161 template<
typename DSS,
typename LambdaFunction>
176 this->first += ch.
first;
177 this->second += ch.
second;
190 Value operator() (
const TDSS& aDSS,
const int & indexOfPointInDSS,
const int & dssLen )
const
193 typename DSS::Point3d directionZ3;
194 RealVector direction;
195 typename DSS::PointR3d intercept;
196 typename DSS::PointR3d thikness;
198 aDSS.getParameters ( directionZ3, intercept, thikness );
199 direction[0] = directionZ3[0];
200 direction[1] = directionZ3[1];
201 direction[2] = directionZ3[2];
205 double norm = direction.
norm();
222 #endif // !defined FunctorsLambdaMST_h
224 #undef FunctorsLambdaMST_RECURSES
225 #endif // else defined(FunctorsLambdaMST_RECURSES)
PointVector< 3, double > RealVector
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< LambdaFunction, double, double >))
LambdaFunction lambdaFunctor
LambdaFunction lambdaFunctor
Aim: Defines a unary functor, which associates arguments to results.
Value operator()(const TDSS &aDSS, const int &indexOfPointInDSS, const int &dssLen) const
Value & operator+=(const Value &ch)
Value & operator+=(const Value &ch)
double operator()(double x) const
DGtal is the top-level namespace which contains all DGtal functions and types.
double norm(const NormType type=L_2) const
double operator()(double x) const
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< LambdaFunction, double, double >))
double operator()(double x) const
PointVector< 2, double > RealVector
Value operator()(const TDSS &aDSS, const int &indexOfPointInDSS, const int &dssLen) const