92 explicit Range(
const T& x );
98 Range(
const Range& rhs,
const T& value,
size_t i );
145 template<
typename T2 >
163 bool inside(
const T& x )
const;
175 template <
typename T2>
176 friend inline std::ostream& operator << ( std::ostream& stream, const Range<T>& range );
182 template <
typename T>
183 inline std::ostream& operator << ( std::ostream& stream, const Range<T>& range )
185 stream << range.lower() <<
" " << range.upper();
251 mMax( std::numeric_limits<T>::infinity() ) {}
321 return mMin == -std::numeric_limits<T>::infinity() && mMax == std::numeric_limits<T>::infinity();
333 this->mMax = rhs.mMax;
335 this->mMin = rhs.mMin;
343 template<
typename T2 >
346 return Range< T >( mMin * (T)rhs, mMax * (T)rhs );
354 if ( x <= lhs.mMin ) {
356 ret.
excess() = lhs.mMin - x;
357 }
else if ( x >= lhs.mMax ) {
359 ret.
excess() = x - lhs.mMax;
369 if ( x < lhs.mMin ) {
371 }
else if ( x > lhs.mMax ) {
381 return (x >= lhs.mMin) && (x <= lhs.mMax) ;
387 return ( inside(r.
lower()) || inside(r.
upper())
395 std::swap(mMax, mMin);
RangeViolation< Real > RangeViolationReal
Range & operator=(const Range &rhs)
Assignment operator.
void Max(AutoT1 &result, const AutoT2 &arg1, const AutoT3 &arg2)
Function: Math.Max Implementation: (default)
void setLower(T lower)
Set the lower bound for the range.
RangeViolation< UInt > RangeViolationUInt
RangeViolation< T > excess(const T &x) const
Compute all the details of range violation: parity is +1 when violating the upper limit...
void Min(AutoT1 &result, const AutoT2 &arg1, const AutoT3 &arg2)
Function: Math.Min Implementation: (default)
bool overlap(const Range< T > &r) const
void setUpper(T upper)
Set the upper bound for the range.
Range< Real > RangeReal
A short hand for ranges of floating point numbers.
A range object has a min and max value of a given type and provides services to tell whether a value ...
This class will store a computed violation of a range.
bool inside(const T &x) const
Range()
Default constructor. Set min/max to -/+ infinity.
Range< UInt > RangeUInt
A short hand for ranges of unsigned integer numbers.
int outside(const T &x) const
RangeViolation()
Default constructor. sign=0, v=0.
Range operator*(const T2 &rhs) const