92 explicit Range(
const T& x );
98 Range(
const Range& rhs,
const T& value,
size_t i );
124 void setLower(T lower);
130 void setUpper(T upper);
135 bool isInfinite()
const;
145 template<
typename T2 >
160 int outside(
const T& x)
const;
163 bool inside(
const T& x )
const;
169 bool overlap(
const Range<T>& r )
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
void Max(AutoT1 &result, const AutoT2 &arg1, const AutoT3 &arg2)
Function: Math.Max Implementation: (default)
RangeViolation< UInt > RangeViolationUInt
void Min(AutoT1 &result, const AutoT2 &arg1, const AutoT3 &arg2)
Function: Math.Min Implementation: (default)
Namespace agx contains the dynamics/math part of the AGX Dynamics API.
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.
Range()
Default constructor. Set min/max to -/+ infinity.
Range< UInt > RangeUInt
A short hand for ranges of unsigned integer numbers.
RangeViolation()
Default constructor. sign=0, v=0.
bool inside(const T &x) const
Vec3T< T > operator*(const Vec3T< T > &v, const AffineMatrix4x4T< T > &m)