38 #ifndef DRAIN_RANGE_H_
39 #define DRAIN_RANGE_H_
45 #include <drain/UniTuple.h>
59 Range(T min=T(), T max=T()) : min(this->next()), max(this->next()) {
64 Range(
const Range & r) : min(this->next()), max(this->next()){
72 min(this->next()),max(this->next()){
99 return (this->min == this->max);
104 bool contains(T x)
const {
105 return (this->min <= x) && (x <= this->max);
109 bool limit(T x)
const {
112 else if (x > this->max)
121 return this->max - this->min;
127 if (this->max > this->min)
128 return this->max - this->min;
130 return this->min - this->max;
143 DRAIN_TYPENAME_T(Range,T);
Range(T min=T(), T max=T())
Default constructor.
Definition: Range.h:59
Range & operator=(const Range< T > &range)
Default assignment operator.
Definition: Range.h:78
Range(const Range &r)
Copy constructor.
Definition: Range.h:64
Tuple of N elements of type T.
Definition: UniTuple.h:65
Definition: DataSelector.cpp:1277