![]() |
A basic mathematical interval class. More...
Public Member Functions | |
| bool | operator== (const GfInterval &rhs) const |
| Equality operator. More... | |
| bool | operator!= (const GfInterval &rhs) const |
| Inequality operator. More... | |
| bool | operator< (const GfInterval &rhs) const |
| Less-than operator. More... | |
| size_t | Hash () const |
| Hash value. More... | |
| double | GetMin () const |
| Minimum value. More... | |
| double | GetMax () const |
| Maximum value. More... | |
| void | SetMin (double v) |
| Set minimum value. More... | |
| void | SetMin (double v, bool minClosed) |
| Set minimum value and boundary condition. More... | |
| void | SetMax (double v) |
| Set maximum value. More... | |
| void | SetMax (double v, bool maxClosed) |
| Set maximum value and boundary condition. More... | |
| bool | IsMinClosed () const |
| Minimum boundary condition. More... | |
| bool | IsMaxClosed () const |
| Maximum boundary condition. More... | |
| bool | IsMinOpen () const |
| Minimum boundary condition. More... | |
| bool | IsMaxOpen () const |
| Maximum boundary condition. More... | |
| bool | IsMaxFinite () const |
| Returns true if the maximum value is finite. More... | |
| bool | IsMinFinite () const |
| Returns true if the minimum value is finite. More... | |
| bool | IsFinite () const |
| Returns true if both the maximum and minimum value are finite. More... | |
| bool | IsEmpty () const |
| Return true iff the interval is empty. More... | |
| double | GetSize () const |
| Width of the interval. More... | |
| double | Size () const |
| bool | Contains (double d) const |
| Return true iff the value d is contained in the interval. More... | |
| bool | In (double d) const |
| bool | Contains (const GfInterval &i) const |
| Return true iff the interval i is entirely contained in the interval. More... | |
| bool | Intersects (const GfInterval &i) const |
| Return true iff the given interval i intersects this interval. More... | |
Constructors | |
| GfInterval () | |
| Construct an empty open interval, (0,0). More... | |
| GfInterval (double val) | |
| Construct a closed interval representing the single point, as [val,val]. More... | |
| GfInterval (double min, double max, bool minClosed=true, bool maxClosed=true) | |
| Construct an interval with the given arguments. More... | |
Math operations | |
| GfInterval & | operator&= (const GfInterval &rhs) |
| Boolean intersection. More... | |
| GfInterval & | operator|= (const GfInterval &rhs) |
| Returns the interval that bounds the union of this interval and rhs. More... | |
| GfInterval & | operator+= (const GfInterval &rhs) |
| Interval addition. More... | |
| GfInterval & | operator-= (const GfInterval &rhs) |
| Interval subtraction. More... | |
| GfInterval | operator- () const |
| Interval unary minus. More... | |
| GfInterval & | operator*= (const GfInterval &rhs) |
| Interval multiplication. More... | |
| bool | operator> (const GfInterval &rhs) |
| Greater than operator. More... | |
| bool | operator<= (const GfInterval &rhs) |
| Less than or equal operator. More... | |
| bool | operator>= (const GfInterval &rhs) |
| Greater than or equal operator. More... | |
| GfInterval | operator| (const GfInterval &rhs) const |
| Union operator. More... | |
| GfInterval | operator& (const GfInterval &rhs) const |
| Intersection operator. More... | |
| GfInterval | operator+ (const GfInterval &rhs) const |
| Addition operator. More... | |
| GfInterval | operator- (const GfInterval &rhs) const |
| Subtraction operator. More... | |
| GfInterval | operator* (const GfInterval &rhs) const |
| Multiplication operator. More... | |
Static Public Member Functions | |
| static GfInterval | GetFullInterval () |
| Returns the full interval (-inf, inf). More... | |
Friends | |
| size_t | hash_value (GfInterval const &i) |
A basic mathematical interval class.
Can represent intervals with either open or closed boundary conditions.
Definition at line 50 of file interval.h.
|
inline |
Construct an empty open interval, (0,0).
Definition at line 57 of file interval.h.
|
inline |
Construct a closed interval representing the single point, as [val,val].
Definition at line 63 of file interval.h.
|
inline |
Construct an interval with the given arguments.
Definition at line 69 of file interval.h.
|
inline |
Return true iff the value d is contained in the interval.
An empty interval contains no values.
Definition at line 185 of file interval.h.
|
inline |
Return true iff the interval i is entirely contained in the interval.
An empty interval contains no intervals, not even other empty intervals.
Definition at line 196 of file interval.h.
|
inlinestatic |
Returns the full interval (-inf, inf).
Definition at line 346 of file interval.h.
|
inline |
Maximum value.
Definition at line 116 of file interval.h.
|
inline |
Minimum value.
Definition at line 113 of file interval.h.
|
inline |
|
inline |
Hash value.
Just a basic hash function, not particularly high quality.
Definition at line 103 of file interval.h.
|
inline |
Return true iff the given interval i intersects this interval.
Definition at line 201 of file interval.h.
|
inline |
Return true iff the interval is empty.
Definition at line 168 of file interval.h.
|
inline |
Returns true if both the maximum and minimum value are finite.
Definition at line 163 of file interval.h.
|
inline |
Maximum boundary condition.
Definition at line 142 of file interval.h.
|
inline |
Returns true if the maximum value is finite.
Definition at line 151 of file interval.h.
|
inline |
Maximum boundary condition.
Definition at line 148 of file interval.h.
|
inline |
Minimum boundary condition.
Definition at line 139 of file interval.h.
|
inline |
Returns true if the minimum value is finite.
Definition at line 157 of file interval.h.
|
inline |
Minimum boundary condition.
Definition at line 145 of file interval.h.
|
inline |
Inequality operator.
Definition at line 83 of file interval.h.
|
inline |
Intersection operator.
Definition at line 312 of file interval.h.
|
inline |
Boolean intersection.
Definition at line 209 of file interval.h.
|
inline |
Multiplication operator.
Definition at line 336 of file interval.h.
|
inline |
Interval multiplication.
Definition at line 275 of file interval.h.
|
inline |
Addition operator.
Definition at line 320 of file interval.h.
|
inline |
Interval addition.
Definition at line 254 of file interval.h.
|
inline |
Interval unary minus.
Definition at line 270 of file interval.h.
|
inline |
Subtraction operator.
Definition at line 328 of file interval.h.
|
inline |
Interval subtraction.
Definition at line 265 of file interval.h.
|
inline |
Less-than operator.
Definition at line 88 of file interval.h.
|
inline |
Less than or equal operator.
Definition at line 292 of file interval.h.
|
inline |
Equality operator.
Definition at line 78 of file interval.h.
|
inline |
Greater than operator.
Definition at line 286 of file interval.h.
|
inline |
Greater than or equal operator.
Definition at line 298 of file interval.h.
|
inline |
Union operator.
Definition at line 304 of file interval.h.
|
inline |
Returns the interval that bounds the union of this interval and rhs.
Definition at line 232 of file interval.h.
|
inline |
Set maximum value.
Definition at line 129 of file interval.h.
|
inline |
Set maximum value and boundary condition.
Definition at line 134 of file interval.h.
|
inline |
Set minimum value.
Definition at line 119 of file interval.h.
|
inline |
Set minimum value and boundary condition.
Definition at line 124 of file interval.h.