AGX Dynamics 2.37.3.4
|
A range object has a min and max value of a given type and provides services to tell whether a value is in that range or not. More...
#include <Range.h>
Public Member Functions | |
Range () | |
Default constructor. Set min/max to -/+ infinity. | |
Range (const Range &rhs) | |
Copy constructor. | |
Range (const Range &rhs, const T &value, size_t i) | |
Range (const T &Min, const T &Max) | |
Standard creation: set min and max. | |
Range (const T &x) | |
Set min=-x and max=x. | |
Range (const Vec2 &vec) | |
Cast operator from Vec2. | |
RangeViolation< T > | excess (const T &x) const |
Compute all the details of range violation: parity is +1 when violating the upper limit, -1 when violating the lower limit, and 0 otherwise. | |
bool | hasInfinite () const |
bool | inside (const T &x) const |
bool | isInfinite () const |
T & | lower () |
T | lower () const |
template<typename T2 > | |
Range | operator* (const T2 &rhs) const |
template<typename T2 > | |
Range< T > | operator* (const T2 &rhs) const |
Range & | operator= (const Range &rhs) |
Assignment operator. | |
int | outside (const T &x) const |
bool | overlap (const Range< T > &r) const |
void | setLower (T lower) |
Set the lower bound for the range. | |
void | setUpper (T upper) |
Set the upper bound for the range. | |
T | span () const |
T & | upper () |
T | upper () const |
A range object has a min and max value of a given type and provides services to tell whether a value is in that range or not.
A range object is setup with upper and lower limits, either or both of which may be infinite as defined in numeric_limits<Real>::infinity()
agx::Range< T >::Range | ( | const T & | Min, |
const T & | Max | ||
) |
|
inlineexplicit |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
Compute all the details of range violation: parity is +1 when violating the upper limit, -1 when violating the lower limit, and 0 otherwise.
The excess is either 0 if the argument is in range, or the (positive) distance to the nearest bound otherwise.
Definition at line 361 of file Range.h.
References agx::RangeViolation< T >::excess(), and agx::RangeViolation< T >::sign().
bool agx::Range< T >::hasInfinite |
bool agx::Range< T >::inside | ( | const T & | x | ) | const |
Definition at line 389 of file Range.h.
Referenced by agx::Range< T >::overlap().
bool agx::Range< T >::isInfinite |
T & agx::Range< T >::lower |
Definition at line 286 of file Range.h.
Referenced by agx::Range< T >::overlap(), and agx::WireContactConstraint::setBounds().
T agx::Range< T >::lower |
Range< T > agx::Range< T >::operator* | ( | const T2 & | rhs | ) | const |
|
inline |
|
inline |
bool agx::Range< T >::overlap | ( | const Range< T > & | r | ) | const |
Definition at line 396 of file Range.h.
References agx::Range< T >::inside(), agx::Range< T >::lower(), and agx::Range< T >::upper().
void agx::Range< T >::setLower | ( | T | lower | ) |
void agx::Range< T >::setUpper | ( | T | upper | ) |
T agx::Range< T >::span |
T & agx::Range< T >::upper |
Definition at line 298 of file Range.h.
Referenced by agx::Range< T >::overlap(), and agx::WireContactConstraint::setBounds().
T agx::Range< T >::upper |