![]() |
|
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 49 of file interval.h.
|
inline |
Construct an empty open interval, (0,0).
Definition at line 56 of file interval.h.
|
inline |
Construct a closed interval representing the single point, as [val,val].
Definition at line 62 of file interval.h.
|
inline |
Construct an interval with the given arguments.
Definition at line 68 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 181 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 192 of file interval.h.
|
inlinestatic |
Returns the full interval (-inf, inf).
Definition at line 342 of file interval.h.
|
inline |
Maximum value.
Definition at line 112 of file interval.h.
|
inline |
Minimum value.
Definition at line 109 of file interval.h.
|
inline |
|
inline |
Hash value.
Just a basic hash function, not particularly high quality.
Definition at line 102 of file interval.h.
|
inline |
Return true iff the given interval i intersects this interval.
Definition at line 197 of file interval.h.
|
inline |
Return true iff the interval is empty.
Definition at line 164 of file interval.h.
|
inline |
Returns true if both the maximum and minimum value are finite.
Definition at line 159 of file interval.h.
|
inline |
Maximum boundary condition.
Definition at line 138 of file interval.h.
|
inline |
Returns true if the maximum value is finite.
Definition at line 147 of file interval.h.
|
inline |
Maximum boundary condition.
Definition at line 144 of file interval.h.
|
inline |
Minimum boundary condition.
Definition at line 135 of file interval.h.
|
inline |
Returns true if the minimum value is finite.
Definition at line 153 of file interval.h.
|
inline |
Minimum boundary condition.
Definition at line 141 of file interval.h.
|
inline |
Intersection operator.
Definition at line 308 of file interval.h.
|
inline |
Multiplication operator.
Definition at line 332 of file interval.h.
|
inline |
Interval multiplication.
Definition at line 271 of file interval.h.
|
inline |
Inequality operator.
Definition at line 82 of file interval.h.
|
inline |
Boolean intersection.
Definition at line 205 of file interval.h.
|
inline |
Addition operator.
Definition at line 316 of file interval.h.
|
inline |
Interval addition.
Definition at line 250 of file interval.h.
|
inline |
Interval unary minus.
Definition at line 266 of file interval.h.
|
inline |
Subtraction operator.
Definition at line 324 of file interval.h.
|
inline |
Interval subtraction.
Definition at line 261 of file interval.h.
|
inline |
Less-than operator.
Definition at line 87 of file interval.h.
|
inline |
Less than or equal operator.
Definition at line 288 of file interval.h.
|
inline |
Equality operator.
Definition at line 77 of file interval.h.
|
inline |
Greater than operator.
Definition at line 282 of file interval.h.
|
inline |
Greater than or equal operator.
Definition at line 294 of file interval.h.
|
inline |
Union operator.
Definition at line 300 of file interval.h.
|
inline |
Returns the interval that bounds the union of this interval and rhs.
Definition at line 228 of file interval.h.
|
inline |
Set maximum value.
Definition at line 125 of file interval.h.
|
inline |
Set maximum value and boundary condition.
Definition at line 130 of file interval.h.
|
inline |
Set minimum value.
Definition at line 115 of file interval.h.
|
inline |
Set minimum value and boundary condition.
Definition at line 120 of file interval.h.