Interval defines the concept of a mathematical interval and provides operations on it including arithmetic operations, construction, and IO.
More...
#include <SurgSim/Math/IntervalArithmetic.h>
|
static Interval< T > | minToMax (const T &a1, const T &a2) |
| Generate an interval from min to max based on the inputs. More...
|
|
static Interval< T > | minToMax (const T &a1, const T &a2, const T &a3) |
| Generate an interval from min to max based on the inputs. More...
|
|
static Interval< T > | minToMax (const T &a1, const T &a2, const T &a3, const T &a4) |
| Generate an interval from min to max based on the inputs. More...
|
|
|
template<class P > |
void | IntervalArithmetic_add (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
| Calculate the sum of two intervals. More...
|
|
template<class P > |
void | IntervalArithmetic_addadd (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
| Calculate the sum of three intervals res + a + b. More...
|
|
template<class P > |
void | IntervalArithmetic_sub (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
| Calculate the difference of two intervals. More...
|
|
template<class P > |
void | IntervalArithmetic_addsub (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
| Add the difference of two intervals to an existing value. More...
|
|
template<class P > |
void | IntervalArithmetic_mul (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
| Calculate the product of two intervals. More...
|
|
template<class P > |
void | IntervalArithmetic_addmul (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
| Add the product of two intervals to an existing value. More...
|
|
template<class P > |
void | IntervalArithmetic_submul (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
| Subtract the product of two intervals from an existing value. More...
|
|
template<class T>
class SurgSim::Math::Interval< T >
Interval defines the concept of a mathematical interval and provides operations on it including arithmetic operations, construction, and IO.
- Template Parameters
-
T | underlying data type over which the interval is defined. |
- See also
- IntervalND<T, N> and IntervalND<T, 3>
◆ Interval() [1/4]
◆ Interval() [2/4]
Constructor.
- Parameters
-
min | Lower bound of the constructed interval |
max | Upper bound of the constructed interval |
- Exceptions
-
◆ Interval() [3/4]
Copy constructor.
- Parameters
-
◆ Interval() [4/4]
Move constructor.
- Parameters
-
◆ addThickness()
Widens the current interval by thickness on both sides.
- Parameters
-
thickness | the amount to widen the current interval on both sides |
- Returns
- the current interval after modification
◆ contains()
- Parameters
-
val | the value to test for inclusion in the interval |
- Returns
- true if the current interval contains val
◆ containsZero()
- Returns
- true if the current interval contains 0
◆ extendToInclude() [1/2]
Widens the current interval on both ends to include i.
- Parameters
-
i | the interval to be wholly contained in the current interval |
- Returns
- the current interval extended to include the entirety of i
◆ extendToInclude() [2/2]
Widens the current interval on one end to include x.
- Parameters
-
x | the value to be included in the interval |
- Returns
- the current interval extended to include x
◆ getMax()
- Returns
- the upper limit of the interval
◆ getMin()
- Returns
- the lower limit of the interval
◆ inverse()
- Returns
- the inverse of the current interval
- Exceptions
-
if | the interval includes 0 |
◆ isApprox()
- Parameters
-
i | the interval to be tested |
epsilon | the nearness parameter |
- Returns
- true if the current interval is within epsilon of the input interval
◆ lowerHalf()
- Returns
- the interval from the lower limit to the midpoint
◆ minToMax() [1/3]
Generate an interval from min to max based on the inputs.
- Parameters
-
a1 | first input value |
a2 | second input value |
- Returns
- an interval spanning the minimum input to the maximum input.
◆ minToMax() [2/3]
Generate an interval from min to max based on the inputs.
- Parameters
-
a1 | first input value |
a2 | second input value |
a3 | third input value |
- Returns
- an interval spanning the minimum input to the maximum input.
◆ minToMax() [3/3]
Generate an interval from min to max based on the inputs.
- Parameters
-
a1 | first input value |
a2 | second input value |
a3 | third input value |
a4 | fourth input value |
- Returns
- an interval spanning the minimum input to the maximum input.
◆ operator!=()
- Parameters
-
i | the interval to be tested |
- Returns
- true if the current interval is not identical to the input interval
◆ operator*() [1/2]
Standard arithmetic operators extended to intervals
◆ operator*() [2/2]
Standard arithmetic operators extended to intervals
◆ operator*=() [1/2]
Standard arithmetic operators extended to intervals
◆ operator*=() [2/2]
Standard arithmetic operators extended to intervals
◆ operator+() [1/2]
Standard arithmetic operators extended to intervals
◆ operator+() [2/2]
Standard arithmetic operators extended to intervals
◆ operator+=() [1/2]
Standard arithmetic operators extended to intervals
◆ operator+=() [2/2]
Standard arithmetic operators extended to intervals
◆ operator-() [1/3]
Standard arithmetic operators extended to intervals
◆ operator-() [2/3]
Standard arithmetic operators extended to intervals
◆ operator-() [3/3]
Standard arithmetic operators extended to intervals
◆ operator-=() [1/2]
Standard arithmetic operators extended to intervals
◆ operator-=() [2/2]
Standard arithmetic operators extended to intervals
◆ operator/()
- Parameters
-
i | the interval to be divided by |
- Returns
- the current interval multiplied by the inverse of i
- Exceptions
-
◆ operator/=()
- Parameters
-
i | the interval to be divided by |
- Returns
- the current interval multiplied by the inverse of i
- Exceptions
-
- Note
- the current interval is modified by this operation
◆ operator=() [1/2]
Assignment operator.
- Parameters
-
◆ operator=() [2/2]
Move assignment operator.
- Parameters
-
◆ operator==()
- Parameters
-
i | the interval to be tested |
- Returns
- true if the current interval is identical to the input interval
◆ overlapsWith()
- Parameters
-
i | the interval the current interval will be tested against |
- Returns
- true if the input interval overlaps the current interval
◆ square()
- Returns
- the square of the current interval
- Note
- if the original interval contains 0, then the result will have the minimum identically set to 0
◆ upperHalf()
- Returns
- the interval from the midpoint to the upper limit
◆ IntervalArithmetic_add
template<class T >
template<class P >
Calculate the sum of two intervals.
- Template Parameters
-
P | underlying type of the interval |
- Parameters
-
a | the first interval |
b | the second interval |
res | [out] the result of a + b |
◆ IntervalArithmetic_addadd
template<class T >
template<class P >
Calculate the sum of three intervals res + a + b.
- Template Parameters
-
P | underlying type of the interval |
- Parameters
-
a | the first interval |
b | the second interval |
res | [in/out] the result of res + a + b |
◆ IntervalArithmetic_addmul
template<class T >
template<class P >
Add the product of two intervals to an existing value.
- Template Parameters
-
P | underlying type of the interval |
- Parameters
-
a | the first interval |
b | the second interval |
res | [in/out] the result of res + (a * b) |
◆ IntervalArithmetic_addsub
template<class T >
template<class P >
Add the difference of two intervals to an existing value.
- Template Parameters
-
P | underlying type of the interval |
- Parameters
-
a | the first interval |
b | the second interval |
res | [in/out] the result of res + (a - b) |
◆ IntervalArithmetic_mul
template<class T >
template<class P >
Calculate the product of two intervals.
- Template Parameters
-
P | underlying type of the interval |
- Parameters
-
a | the first interval |
b | the second interval |
res | [out] the result of a * b |
◆ IntervalArithmetic_sub
template<class T >
template<class P >
Calculate the difference of two intervals.
- Template Parameters
-
P | underlying type of the interval |
- Parameters
-
a | the first interval |
b | the second interval |
res | [out] the result of a - b |
◆ IntervalArithmetic_submul
template<class T >
template<class P >
Subtract the product of two intervals from an existing value.
- Template Parameters
-
P | underlying type of the interval |
- Parameters
-
a | the first interval |
b | the second interval |
res | [in/out] the result of res - (a * b) |
◆ m_max
◆ m_min
The lower (m_min) and upper (m_max) limits of the interval.
The documentation for this class was generated from the following files: