DGtal  1.3.beta
BasicFunctors.h
1 
17 #pragma once
18 
36 #if defined(BasicFunctors_RECURSES)
37 #error Recursive header files inclusion detected in BasicFunctors.h
38 #else // defined(BasicFunctors_RECURSES)
39 
40 #define BasicFunctors_RECURSES
41 
42 #if !defined BasicFunctors_h
43 
44 #define BasicFunctors_h
45 
47 // Inclusions
48 #include <algorithm>
49 #include <functional>
50 #include <cmath>
51 #include "DGtal/io/Color.h"
52 #include "DGtal/base/Common.h"
53 #include "DGtal/base/BasicBoolFunctors.h"
55 
56 namespace DGtal
57 {
58  namespace functors
59 {
63  template<typename T>
64  struct Min
65  {
66  inline
67  T operator() (const T&a, const T&b) const
68  { return std::min(a,b); }
69  };
70 
71  template<typename T>
72  struct Max
73  {
74  inline
75  T operator() (const T&a, const T&b) const
76  { return std::max(a,b); }
77  };
78 
82  template <class T>
83  struct Minus
84  {
85  T operator() (const T& x, const T& y) const
86  {return x-y;}
87  };
88 
92  template <class T = void>
93  struct Abs
94  {
95  inline
96  T operator() (const T &x) const
97  {
98  if (x < 0)
99  return -x;
100  else
101  return x;
102  }
103  };
104 
108  template <class T>
109  struct UnaryMinus
110  {
115  inline
116  T operator() (const T &x) const
117  {
118  return -x;
119  }
120  };
121 
125  template <class T>
127  {
128  inline
129  MultiplicationByScalar( const T & aValue )
130  : myValue( aValue )
131  {}
132 
137  inline
138  T operator() (const T &x) const
139  {
140  return myValue * x;
141  }
142 
144  };
145 
150  template < typename T = void >
151  struct Round
152  {
153  inline
154  auto operator() ( const T & value ) const
155  -> decltype(std::round(value))
156  {
157  return std::round( value );
158  }
159  };
160 
167  template <>
168  struct Round<void>
169  {
170  template < typename T >
171  inline
172  auto operator() ( const T & value ) const
173  -> decltype(std::round(value))
174  {
175  return std::round( value );
176  }
177  };
178 
183  template < typename T = void >
184  struct Floor
185  {
186  inline
187  auto operator() ( const T & value ) const
188  -> decltype(std::floor(value))
189  {
190  return std::floor( value );
191  }
192  };
193 
200  template <>
201  struct Floor<void>
202  {
203  template < typename T >
204  inline
205  auto operator() ( const T & value ) const
206  -> decltype(std::floor(value))
207  {
208  return std::floor( value );
209  }
210  };
211 
216  template < typename T = void >
217  struct Ceil
218  {
219  inline
220  auto operator() ( const T & value ) const
221  -> decltype(std::ceil(value))
222  {
223  return std::ceil( value );
224  }
225  };
226 
233  template <>
234  struct Ceil<void>
235  {
236  template < typename T >
237  inline
238  auto operator() ( const T & value ) const
239  -> decltype(std::ceil(value))
240  {
241  return std::ceil( value );
242  }
243  };
244 
249  template < typename T = void >
250  struct Trunc
251  {
252  inline
253  auto operator() ( const T & value ) const
254  -> decltype(std::trunc(value))
255  {
256  return std::trunc( value );
257  }
258  };
259 
266  template <>
267  struct Trunc<void>
268  {
269  template < typename T >
270  inline
271  auto operator() ( const T & value ) const
272  -> decltype(std::trunc(value))
273  {
274  return std::trunc( value );
275  }
276  };
277 
279 // Some basic unary functors that may be useful
281 
287  struct Identity
288  {
294  template <typename T >
295  inline
296  T operator()(const T& aT) const
297  {
298  return aT;
299  }
300  };
301 
309  template <typename TValue>
311  {
312  public:
313  typedef TValue Value;
314 
319  ConstValue(const Value& aValue = 0)
320  :myValue(aValue) {};
321 
329  template <typename TInput>
330  inline
331  Value operator()(const TInput& /*aInput*/) const
332  {
333  return myValue;
334  }
335 
336  private:
341 
342  };
343 
352  template <typename TQuantity, typename TCell>
354  {
355  public:
356  typedef TCell Cell;
357  typedef TQuantity Quantity;
358 
363  ConstValueCell(const Quantity& aQuantity = 0)
364  :myQuantity(aQuantity) {}
365 
371  inline
372  Quantity operator()(const Cell& /*aInput*/) const
373  {
374  return myQuantity;
375  }
376 
377  private:
382 
383  };
384 
385 
392  template <typename TOutput >
393  struct Cast
394  {
400  template<typename TInput>
401  inline
402  TOutput operator()(const TInput& aInput) const
403  {
404  return static_cast<TOutput>(aInput);
405  }
406  };
407 
416  template <typename TFunctor1, typename TFunctor2, typename ReturnType >
417  class Composer
418  {
419  public:
421  typedef ReturnType Value;
422 
426  Composer(): myF1(NULL), myF2(NULL) {}
432  Composer(const TFunctor1& aF1, const TFunctor2& aF2): myF1(&aF1), myF2(&aF2) {}
437  Composer(const Composer& other): myF1(other.myF1), myF2(other.myF2) {}
438 
443  Composer& operator=(const Composer& other)
444  {
445  if (this != &other)
446  {
447  myF1 = other.myF1;
448  myF2 = other.myF2;
449  }
450  return *this;
451  }
452 
453 
466  template<typename TInput>
467  inline
468  ReturnType operator()(const TInput& aInput) const
469  {
470  ASSERT( myF1 );
471  ASSERT( myF2 );
472  return myF2->operator()( myF1->operator()( aInput ) );
473  }
474 
475  private:
479  const TFunctor1* myF1;
483  const TFunctor2* myF2;
484  };
485 
499 template <typename T, bool isLower = true, bool isEqual = true >
501  {
502  public:
505 
506  typedef T Input;
507 
512  Thresholder(const Input& aT = 0):myT(aT) {}
518  bool operator()(const Input& aI) const {
519  std::less_equal<Input> c;
520  return c(aI,myT);
521  }
522  private:
527 };
528 
529 //specializations
530 template <typename T>
531 struct Thresholder<T,false,false>
532 {
533 
534  public:
537 
538  typedef T Input;
539 
540  Thresholder(const Input& aT = 0):myT(aT) {}
541 
542  bool operator()(const Input& aI) const {
543  std::greater<Input> c;
544  return c(aI,myT);
545  }
546 
547  private:
549 };
550 template <typename T>
551 struct Thresholder<T,false,true>
552  {
553  public:
556 
557  typedef T Input;
558 
559  Thresholder(const Input& aT = 0):myT(aT) {}
560  bool operator()(const Input& aI) const {
561  std::greater_equal<Input> c;
562  return c(aI,myT);
563  }
564 
565  private:
567 };
568 
569 template <typename T>
570 struct Thresholder<T,true,false>
571  {
572  public:
575 
576  typedef T Input;
577 
578  Thresholder(const Input& aT = 0):myT(aT) {}
579 
580  bool operator()(const Input& aI) const {
581  std::less<Input> c;
582  return c(aI,myT);
583  }
584 
585  private:
587 };
588 
589 template <typename T>
590 struct Thresholder<T,true,true>
591  {
592  public:
595 
596  typedef T Input;
597 
598  Thresholder(const Input& aT = 0):myT(aT) {}
599 
600  bool operator()(const Input& aI) const {
601  std::less_equal<Input> c;
602  return c(aI,myT);
603  }
604 
605  private:
607 };
608 
610  // template class PredicateCombiner
620  template <typename TPredicate1, typename TPredicate2,
621  typename TBinaryFunctor = BoolFunctor2 >
623  {
624  typedef TPredicate1 Predicate1;
625  typedef TPredicate2 Predicate2;
626 
635  const Predicate2 & pred2,
636  const TBinaryFunctor & boolFunctor )
637  : myPred1( &pred1 ), myPred2( &pred2 ), myBoolFunctor( &boolFunctor )
638  {
639  }
640 
646  : myPred1( other.myPred1 ), myPred2( other.myPred2 ), myBoolFunctor( other.myBoolFunctor )
647  {
648  }
649 
656  {
657  if (this != &other)
658  {
659  myPred1 = other.myPred1;
660  myPred2 = other.myPred2;
662  }
663  return *this;
664  }
665 
670 
677  template<typename T>
678  bool operator()( const T & t ) const
679  {
680  return myBoolFunctor->operator()( myPred1->operator()( t ),
681  myPred2->operator()( t ) );
682  }
683 
689  const TBinaryFunctor* myBoolFunctor;
690  };
691 
699 template <typename T>
701 {
702 public:
705 
707  typedef T Input;
708 
713 
719  IntervalThresholder(const Input& low, const Input& up)
720  : myTlow( low), myTup ( up ),
721  myPred( myTlow, myTup, AndBoolFct2() ) {}
722 
728  bool operator()(const Input& aI) const
729  {
730  return myPred(aI);
731  }
732 private:
745 };
746 
747 
755  template <typename ReturnType>
756  class Pair1st
757  {
758  public:
759 
768  template <typename TPair>
769  inline
770  ReturnType operator()(const TPair& aPair) const
771  {
772  return aPair.first;
773  }
774 
775  };
776 
784  template <typename ReturnType>
785  class Pair2nd
786  {
787  public:
788 
797  template <typename TPair>
798  inline
799  ReturnType operator()(const TPair& aPair) const
800  {
801  return aPair.second;
802  }
803 
804  };
805 
814  template <typename ReturnType>
816  {
817  public:
818 
827  template <typename TPair>
828  inline
829  ReturnType& operator()(TPair& aPair) const
830  {
831  return aPair.first;
832  }
833 
842  template <typename TPair>
843  inline
844  const ReturnType& operator()(const TPair& aPair) const
845  {
846  return aPair.first;
847  }
848 
849  };
850 
859  template <typename ReturnType>
861  {
862  public:
863 
872  template <typename TPair>
873  inline
874  ReturnType& operator()(TPair& aPair) const
875  {
876  return aPair.second;
877  }
878 
887  template <typename TPair>
888  inline
889  const ReturnType& operator()(const TPair& aPair) const
890  {
891  return aPair.second;
892  }
893 
894  };
895 
904  template<typename TInputType, typename TOutputType>
905  struct Rescaling
906  {
907  TInputType myInitMin;
908  TInputType myInitMax;
909  TInputType myInitRange;
910 
911  TOutputType myNewMin;
912  TOutputType myNewMax;
913  TOutputType myNewRange;
914 
923  Rescaling( const TInputType &initMin, const TInputType &initMax, const TOutputType &newMin, const TOutputType &newMax ) :
924  myInitMin(initMin), myInitMax(initMax), myInitRange(initMax-initMin), myNewMin(newMin), myNewMax(newMax), myNewRange(newMax-newMin) {}
933  inline
934  TOutputType operator() (const TInputType& anInitVal) const
935  { return anInitVal<myInitMin ? myNewMin : anInitVal > myInitMax ? myNewMax : (anInitVal-myInitMin)*myNewRange/myInitRange + myNewMin; }
936  };
937 
938 
947  {
953  GaussianKernel(const double aSigma) :mySigma(aSigma)
954  {
955  myCoef = 1.0/(mySigma * sqrt(2.0*M_PI));
956  myCoef2 = 1.0/(2.0*M_PI);
957  }
958 
963  inline
964  double operator()(const double aVal) const
965  {
966  ASSERT((aVal <= 1) && (aVal>=0));
967  return myCoef*exp(-aVal*aVal*myCoef2);
968  }
969 
971  double mySigma;
972 
974  double myCoef;
975  private:
977  double myCoef2;
978  };
979 }
980 }
982 
983 
984 #endif // !defined BasicFunctors_h
985 
986 #undef BasicFunctors_RECURSES
987 #endif // else defined(BasicFunctors_RECURSES)
DGtal::functors::Thresholder::operator()
bool operator()(const Input &aI) const
Definition: BasicFunctors.h:518
DGtal::functors::Thresholder
Aim: A small functor with an operator () that compares one value to a threshold value according to tw...
Definition: BasicFunctors.h:500
DGtal::functors::IntervalThresholder::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::EqualityComparable< T >))
DGtal::functors::IntervalThresholder::Input
T Input
input type
Definition: BasicFunctors.h:707
DGtal::functors::Pair1st
Aim: Define a simple functor that returns the first member of a pair.
Definition: BasicFunctors.h:756
DGtal::functors::Thresholder< T, false, true >::operator()
bool operator()(const Input &aI) const
Definition: BasicFunctors.h:560
DGtal::functors::Thresholder< T, false, true >::myT
Input myT
Definition: BasicFunctors.h:566
DGtal::functors::Min::operator()
T operator()(const T &a, const T &b) const
Definition: BasicFunctors.h:67
DGtal::functors::Round::operator()
auto operator()(const T &value) const -> decltype(std::round(value))
Definition: BasicFunctors.h:154
DGtal::functors::Composer::Composer
Composer(const TFunctor1 &aF1, const TFunctor2 &aF2)
Definition: BasicFunctors.h:432
DGtal::functors::Composer
Aim: Define a new Functor from the composition of two other functors.
Definition: BasicFunctors.h:417
DGtal::functors::Abs::operator()
T operator()(const T &x) const
Definition: BasicFunctors.h:96
DGtal::functors::Rescaling::Rescaling
Rescaling(const TInputType &initMin, const TInputType &initMax, const TOutputType &newMin, const TOutputType &newMax)
Definition: BasicFunctors.h:923
DGtal::functors::Thresholder< T, false, false >::Input
T Input
Definition: BasicFunctors.h:538
DGtal::functors::GaussianKernel::GaussianKernel
GaussianKernel(const double aSigma)
Definition: BasicFunctors.h:953
DGtal::functors::PredicateCombiner::PredicateCombiner
PredicateCombiner(const Predicate1 &pred1, const Predicate2 &pred2, const TBinaryFunctor &boolFunctor)
Definition: BasicFunctors.h:634
max
int max(int a, int b)
Definition: testArithmeticalDSS.cpp:1108
DGtal::functors::Rescaling::myInitMax
TInputType myInitMax
Definition: BasicFunctors.h:908
DGtal::functors::Thresholder::Input
T Input
Definition: BasicFunctors.h:506
DGtal::functors::Rescaling::myInitRange
TInputType myInitRange
Definition: BasicFunctors.h:909
DGtal::functors::Composer::Composer
Composer(const Composer &other)
Definition: BasicFunctors.h:437
DGtal::functors::PredicateCombiner::Predicate1
TPredicate1 Predicate1
Definition: BasicFunctors.h:624
DGtal::functors::Pair2ndMutator::operator()
const ReturnType & operator()(const TPair &aPair) const
Definition: BasicFunctors.h:889
DGtal::functors::Ceil::operator()
auto operator()(const T &value) const -> decltype(std::ceil(value))
Definition: BasicFunctors.h:220
DGtal::functors::Thresholder< T, false, false >::Thresholder
Thresholder(const Input &aT=0)
Definition: BasicFunctors.h:540
boost::LessThanComparable
Go to http://www.sgi.com/tech/stl/LessThanComparable.html.
Definition: Boost.dox:48
DGtal::functors::PredicateCombiner::operator=
PredicateCombiner & operator=(const PredicateCombiner &other)
Definition: BasicFunctors.h:655
DGtal::functors::Composer::Composer
Composer()
Definition: BasicFunctors.h:426
DGtal::functors::ConstValue::Value
TValue Value
Definition: BasicFunctors.h:313
DGtal::functors::Composer::myF2
const TFunctor2 * myF2
Definition: BasicFunctors.h:483
DGtal::functors::Rescaling::myInitMin
TInputType myInitMin
Definition: BasicFunctors.h:907
DGtal::functors::Max
Definition: BasicFunctors.h:72
DGtal::functors::Rescaling::myNewMax
TOutputType myNewMax
Definition: BasicFunctors.h:912
DGtal::functors::Thresholder< T, false, false >::operator()
bool operator()(const Input &aI) const
Definition: BasicFunctors.h:542
DGtal::functors::GaussianKernel
Aim: defines a functor on double numbers which corresponds to a Gaussian convolution kernel....
Definition: BasicFunctors.h:946
DGtal::functors::Rescaling::myNewMin
TOutputType myNewMin
Definition: BasicFunctors.h:911
DGtal::functors::Thresholder< T, false, false >::myT
Input myT
Definition: BasicFunctors.h:548
DGtal::functors::Thresholder< T, true, true >::Thresholder
Thresholder(const Input &aT=0)
Definition: BasicFunctors.h:598
DGtal::functors::PredicateCombiner::operator()
bool operator()(const T &t) const
Definition: BasicFunctors.h:678
DGtal::functors::Round
Functor that rounds to the nearest integer.
Definition: BasicFunctors.h:151
DGtal::functors::Rescaling
Aim: Functor allowing to rescale a value. Values of the initial scale [initMin,initMax] are rescaled ...
Definition: BasicFunctors.h:905
DGtal::functors::Composer::operator=
Composer & operator=(const Composer &other)
Definition: BasicFunctors.h:443
DGtal::functors::Identity
Aim: Define a simple default functor that just returns its argument.
Definition: BasicFunctors.h:287
DGtal::functors::IntervalThresholder::IntervalThresholder
IntervalThresholder(const Input &low, const Input &up)
Definition: BasicFunctors.h:719
DGtal::functors::Pair1stMutator::operator()
const ReturnType & operator()(const TPair &aPair) const
Definition: BasicFunctors.h:844
DGtal::functors::Cast
Aim: Define a simple functor using the static cast operator.
Definition: BasicFunctors.h:393
DGtal::functors::Rescaling::operator()
TOutputType operator()(const TInputType &anInitVal) const
Definition: BasicFunctors.h:934
DGtal::functors::MultiplicationByScalar::myValue
T myValue
Definition: BasicFunctors.h:143
DGtal::functors::Abs
Definition: BasicFunctors.h:93
DGtal::functors::Pair2nd
Aim: Define a simple functor that returns the second member of a pair.
Definition: BasicFunctors.h:785
DGtal::functors::PredicateCombiner::myPred2
const Predicate2 * myPred2
aliasing pointer to the right predicate.
Definition: BasicFunctors.h:687
DGtal::functors::Floor::operator()
auto operator()(const T &value) const -> decltype(std::floor(value))
Definition: BasicFunctors.h:187
DGtal::functors::Thresholder< T, false, true >::Thresholder
Thresholder(const Input &aT=0)
Definition: BasicFunctors.h:559
DGtal::functors::Min
Duplicated STL functors.
Definition: BasicFunctors.h:64
DGtal::functors::Trunc::operator()
auto operator()(const T &value) const -> decltype(std::trunc(value))
Definition: BasicFunctors.h:253
DGtal::functors::Identity::operator()
T operator()(const T &aT) const
Definition: BasicFunctors.h:296
DGtal::functors::Composer::operator()
ReturnType operator()(const TInput &aInput) const
Definition: BasicFunctors.h:468
DGtal::functors::PredicateCombiner::~PredicateCombiner
~PredicateCombiner()
Definition: BasicFunctors.h:669
DGtal::functors::Thresholder< T, true, false >::myT
Input myT
Definition: BasicFunctors.h:586
DGtal::functors::GaussianKernel::myCoef
double myCoef
Temporary variable.
Definition: BasicFunctors.h:974
DGtal::functors::Thresholder< T, true, true >::Input
T Input
Definition: BasicFunctors.h:596
DGtal::functors::Thresholder::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::EqualityComparable< T >))
DGtal::functors::ConstValueCell::operator()
Quantity operator()(const Cell &) const
Definition: BasicFunctors.h:372
DGtal::functors::Ceil
Functor that rounds up.
Definition: BasicFunctors.h:217
DGtal::functors::PredicateCombiner::PredicateCombiner
PredicateCombiner(const PredicateCombiner &other)
Definition: BasicFunctors.h:645
DGtal::functors::GaussianKernel::operator()
double operator()(const double aVal) const
Definition: BasicFunctors.h:964
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::functors::BoolFunctor2
boost::function2< bool, bool, bool > BoolFunctor2
Definition: BasicBoolFunctors.h:64
DGtal::functors::IntervalThresholder::myTlow
Tlow myTlow
Definition: BasicFunctors.h:736
DGtal::functors::Pair1st::operator()
ReturnType operator()(const TPair &aPair) const
Definition: BasicFunctors.h:770
DGtal::functors::ConstValueCell::myQuantity
Quantity myQuantity
Definition: BasicFunctors.h:381
DGtal::functors::ConstValue::myValue
Value myValue
Definition: BasicFunctors.h:340
DGtal::functors::MultiplicationByScalar::operator()
T operator()(const T &x) const
Definition: BasicFunctors.h:138
DGtal::functors::ConstValueCell
Aim: Define a simple functor that returns a constant quantity (0 by default).
Definition: BasicFunctors.h:353
DGtal::functors::IntervalThresholder::myTup
Tup myTup
Definition: BasicFunctors.h:740
DGtal::functors::MultiplicationByScalar
Definition: BasicFunctors.h:126
DGtal::functors::Thresholder< T, true, false >::Thresholder
Thresholder(const Input &aT=0)
Definition: BasicFunctors.h:578
DGtal::functors::PredicateCombiner::Predicate2
TPredicate2 Predicate2
Definition: BasicFunctors.h:625
DGtal::functors::Composer::myF1
const TFunctor1 * myF1
Definition: BasicFunctors.h:479
DGtal::functors::Thresholder::myT
Input myT
Definition: BasicFunctors.h:526
DGtal::functors::ConstValueCell::Cell
TCell Cell
Definition: BasicFunctors.h:356
DGtal::functors::GaussianKernel::myCoef2
double myCoef2
Temporary variable.
Definition: BasicFunctors.h:977
DGtal::functors::Thresholder< T, true, true >
Definition: BasicFunctors.h:590
DGtal::functors::Pair1stMutator
Aim: Define a simple unary functor that returns a reference on the first member of a pair in order to...
Definition: BasicFunctors.h:815
DGtal::functors::Pair2ndMutator::operator()
ReturnType & operator()(TPair &aPair) const
Definition: BasicFunctors.h:874
DGtal::functors::Minus
Definition: BasicFunctors.h:83
DGtal::functors::IntervalThresholder::Tup
Thresholder< T, true, true > Tup
Definition: BasicFunctors.h:711
DGtal::functors::ConstValue
Aim: Define a simple functor that returns a constant value (0 by default).
Definition: BasicFunctors.h:310
DGtal::functors::IntervalThresholder::myPred
CombinedPredicate myPred
Definition: BasicFunctors.h:744
DGtal::functors::ConstValueCell::ConstValueCell
ConstValueCell(const Quantity &aQuantity=0)
Definition: BasicFunctors.h:363
DGtal::functors::Cast::operator()
TOutput operator()(const TInput &aInput) const
Definition: BasicFunctors.h:402
DGtal::functors::UnaryMinus
Definition: BasicFunctors.h:109
DGtal::functors::Thresholder< T, true, true >::operator()
bool operator()(const Input &aI) const
Definition: BasicFunctors.h:600
DGtal::functors::GaussianKernel::mySigma
double mySigma
Sigma parameter.
Definition: BasicFunctors.h:971
DGtal::functors::PredicateCombiner
Aim: The predicate returns true when the given binary functor returns true for the two Predicates giv...
Definition: BasicFunctors.h:622
DGtal::functors::Pair2ndMutator
Aim: Define a simple unary functor that returns a reference on the first member of a pair in order to...
Definition: BasicFunctors.h:860
DGtal::functors::ConstValueCell::Quantity
TQuantity Quantity
Definition: BasicFunctors.h:357
DGtal::functors::Rescaling::myNewRange
TOutputType myNewRange
Definition: BasicFunctors.h:913
DGtal::functors::UnaryMinus::operator()
T operator()(const T &x) const
Definition: BasicFunctors.h:116
DGtal::functors::IntervalThresholder::operator()
bool operator()(const Input &aI) const
Definition: BasicFunctors.h:728
DGtal::functors::Trunc
Functor that rounds towards zero.
Definition: BasicFunctors.h:250
DGtal::functors::AndBoolFct2
Definition: BasicBoolFunctors.h:122
DGtal::functors::Minus::operator()
T operator()(const T &x, const T &y) const
Definition: BasicFunctors.h:85
DGtal::functors::Thresholder< T, false, true >::Input
T Input
Definition: BasicFunctors.h:557
DGtal::functors::Pair1stMutator::operator()
ReturnType & operator()(TPair &aPair) const
Definition: BasicFunctors.h:829
DGtal::functors::IntervalThresholder::CombinedPredicate
PredicateCombiner< Tlow, Tup, AndBoolFct2 > CombinedPredicate
Definition: BasicFunctors.h:712
DGtal::functors::ConstValue::ConstValue
ConstValue(const Value &aValue=0)
Definition: BasicFunctors.h:319
boost::EqualityComparable
Go to http://www.sgi.com/tech/stl/EqualityComparable.html.
Definition: Boost.dox:46
DGtal::functors::Max::operator()
T operator()(const T &a, const T &b) const
Definition: BasicFunctors.h:75
DGtal::functors::Thresholder< T, true, true >::myT
Input myT
Definition: BasicFunctors.h:606
DGtal::functors::PredicateCombiner::myBoolFunctor
const TBinaryFunctor * myBoolFunctor
aliasing pointer to the binary functor.
Definition: BasicFunctors.h:689
DGtal::functors::Floor
Functor that rounds down.
Definition: BasicFunctors.h:184
DGtal::functors::Thresholder< T, true, false >::operator()
bool operator()(const Input &aI) const
Definition: BasicFunctors.h:580
DGtal::functors::ConstValue::operator()
Value operator()(const TInput &) const
Definition: BasicFunctors.h:331
DGtal::functors::Composer::Value
ReturnType Value
Necessary for DistanceVisitor.
Definition: BasicFunctors.h:421
DGtal::functors::IntervalThresholder
Aim: A small functor with an operator () that compares one value to an interval.
Definition: BasicFunctors.h:700
DGtal::functors::Thresholder< T, true, false >::Input
T Input
Definition: BasicFunctors.h:576
DGtal::functors::MultiplicationByScalar::MultiplicationByScalar
MultiplicationByScalar(const T &aValue)
Definition: BasicFunctors.h:129
DGtal::functors::IntervalThresholder::Tlow
Thresholder< T, false, true > Tlow
predicates type
Definition: BasicFunctors.h:710
DGtal::functors::Thresholder< T, false, true >
Definition: BasicFunctors.h:551
DGtal::functors::Thresholder::Thresholder
Thresholder(const Input &aT=0)
Definition: BasicFunctors.h:512
DGtal::functors::Pair2nd::operator()
ReturnType operator()(const TPair &aPair) const
Definition: BasicFunctors.h:799
DGtal::functors::PredicateCombiner::myPred1
const Predicate1 * myPred1
aliasing pointer to the left predicate.
Definition: BasicFunctors.h:685