30 #ifndef _ADJACENT_FUNCTOR_HXX_
31 #define _ADJACENT_FUNCTOR_HXX_
33 #include "ConstTraits.hxx"
35 #include "DisplayPair.hxx"
43 typedef typename ConstTrait<T>::NonConstType TNoConst;
48 bool _minFound,_maxFound,_equal;
51 _minFound(
false),_maxFound(
false),
55 bool operator()(
const T &v1) {
57 std::cout <<
"AdjacentFunctor: " << _minValue << _maxValue << std::endl;
58 std::cout <<
"AdjacentFunctor: " << _min << _max << std::endl;
60 if ( v1 <= _minValue && v1 >= _maxValue)
64 std::cout <<
"AdjacentFunctor: _equal : " << v1 << std::endl;
70 _min=v1;_minFound=
true;
72 std::cout <<
"AdjacentFunctor: _minFound : " <<_min << std::endl;
75 else if ( v1 > _maxValue )
77 _max=v1;_maxFound=
true;
79 std::cout <<
"AdjacentFunctor: _maxFound : " <<_max << std::endl;
100 return ( _minFound && _maxFound );
103 void setMaxValue(
const T & value) {_maxValue = value;}
104 bool isEqual()
const {
return _equal;}
105 bool isBounded()
const {
return _minFound && _maxFound;}
106 bool getBounds(TNoConst & min, TNoConst & max)
const {
108 std::cout <<
"_minFound : " <<_minFound <<
", _maxFound " << _maxFound << std::endl;
110 if (_minFound && _maxFound ) { min=_min; max=_max;
return true; }
113 void reset() { _minFound =
false; _maxFound =
false; _equal =
false; };