83 Range(
const T& Min,
const T& Max );
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;
140 bool hasInfinite()
const;
150 template<
typename T2 >
165 int outside(
const T& x)
const;
168 bool inside(
const T& x )
const;
174 bool overlap(
const Range<T>& r )
const;
180 template <
typename T2>
181 friend inline std::ostream& operator << ( std::ostream& stream, const Range<T>& range );
187 template <
typename T>
188 inline std::ostream& operator << ( std::ostream& stream, const Range<T>& range )
190 stream << range.lower() <<
" " << range.upper();
256 mMax(
std::numeric_limits<T>::infinity() ) {}
326 return mMin == -std::numeric_limits<T>::infinity() && mMax == std::numeric_limits<T>::infinity();
332 return std::isinf(mMin) || std::isinf(mMax);
344 this->mMax = rhs.mMax;
346 this->mMin = rhs.mMin;
354 template<
typename T2 >
357 return Range< T >( mMin * (T)rhs, mMax * (T)rhs );
365 if ( x <= lhs.mMin ) {
367 ret.
excess() = lhs.mMin - x;
368 }
else if ( x >= lhs.mMax ) {
370 ret.
excess() = x - lhs.mMax;
380 if ( x < lhs.mMin ) {
382 }
else if ( x > lhs.mMax ) {
392 return (x >= lhs.mMin) && (x <= lhs.mMax) ;
398 return ( inside(r.
lower()) || inside(r.
upper())
406 std::swap(mMax, mMin);
RangeViolation< Real > RangeViolationReal
RangeViolation< UInt > RangeViolationUInt
The agx namespace 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)