83 Range(
const T& Min,
const T& Max );
145 template<
typename T2 >
175 template <
typename T2>
182 template <
typename T>
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);
This class will store a computed violation of a range.
RangeViolation()
Default constructor. sign=0, v=0.
A range object has a min and max value of a given type and provides services to tell whether a value ...
Range(const Vec2 &vec)
Cast operator from Vec2.
Range(const T &Min, const T &Max)
Standard creation: set min and max.
Range(const Range &rhs)
Copy constructor.
bool inside(const T &x) const
Range & operator=(const Range &rhs)
Assignment operator.
Range(const T &x)
Set min=-x and max=x.
Range(const Range &rhs, const T &value, size_t i)
RangeViolation< T > excess(const T &x) const
Compute all the details of range violation: parity is +1 when violating the upper limit,...
Range operator*(const T2 &rhs) const
int outside(const T &x) const
void setUpper(T upper)
Set the upper bound for the range.
friend std::ostream & operator<<(std::ostream &stream, const Range< T > &range)
void setLower(T lower)
Set the lower bound for the range.
Range()
Default constructor. Set min/max to -/+ infinity.
bool overlap(const Range< T > &r) const
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Range< UInt > RangeUInt
A short hand for ranges of unsigned integer numbers.
RangeViolation< Real > RangeViolationReal
RangeViolation< UInt > RangeViolationUInt
Range< Real > RangeReal
A short hand for ranges of floating point numbers.
std::ostream & operator<<(std::ostream &stream, const AtomicValueT< T > &value)