SurgSim::Math::IntervalND< T, N > Class Template Reference

IntervalND defines the concept of a group of mathematical intervals and provides operations on them including arithmetic operations, construction, and IO. More...

`#include <SurgSim/Math/IntervalArithmetic.h>`

## Public Member Functions

| IntervalND ()
| Constructor. More...
| IntervalND (const std::array< Interval< T >, N > &x)
| Constructor. More...
| IntervalND (const IntervalND< T, N > &interval)
| Copy constructor. More...
| IntervalND (IntervalND< T, N > &&i)
| Move constructor. More...
| IntervalND (const std::array< T, N > &a, const std::array< T, N > &b)
| Constructor. More...
IntervalND< T, N > & | operator= (const IntervalND< T, N > &interval)
| Assignment operator. More...
IntervalND< T, N > & | operator= (IntervalND< T, N > &&i)
| Move assignment operator. More...
bool | overlapsWith (const IntervalND< T, N > &interval) const
bool | isApprox (const IntervalND< T, N > &interval, const T &epsilon) const
bool | operator== (const IntervalND< T, N > &interval) const
bool | operator!= (const IntervalND< T, N > &interval) const
IntervalND< T, N > & | addThickness (const T &thickness)
| Widens every interval in the current interval group by thickness on both sides. More...
IntervalND< T, N > | inverse () const
IntervalND< T, N > | operator/ (const IntervalND< T, N > &interval) const
IntervalND< T, N > & | operator/= (const IntervalND< T, N > &interval)
Interval< T > | dotProduct (const IntervalND< T, N > &interval) const
Interval< T > | magnitudeSquared () const
Interval< T > | magnitude () const
const Interval< T > & | getAxis (size_t i) const
IntervalND< T, N > | operator+ (const IntervalND< T, N > &interval) const
IntervalND< T, N > & | operator+= (const IntervalND< T, N > &interval)
IntervalND< T, N > | operator- (const IntervalND< T, N > &interval) const
IntervalND< T, N > & | operator-= (const IntervalND< T, N > &interval)
IntervalND< T, N > | operator* (const IntervalND< T, N > &interval) const
IntervalND< T, N > & | operator*= (const IntervalND< T, N > &interval)

## Private Attributes

std::array< Interval< T >, N > | m_interval
| The N dimensional group of intervals. More...

## Detailed Description

### template<class T, int N>
class SurgSim::Math::IntervalND< T, N >

IntervalND defines the concept of a group of mathematical intervals and provides operations on them including arithmetic operations, construction, and IO.

Template Parameters

  T | underlying data type over which the interval is defined.
  N | number of intervals in the group.

See also
  Interval<T> and IntervalND<T, 3>

## Constructor & Destructor Documentation

## IntervalND() [1/5]

template<class T , int N>

SurgSim::Math::IntervalND< T, N >::IntervalND | ( |  | ) |

Constructor.

## IntervalND() [2/5]

template<class T , int N>

SurgSim::Math::IntervalND< T, N >::IntervalND | ( | const std::array< Interval< T >, N > & | x | ) |

explicit

Constructor.

Parameters

  x | array of N intervals to be copied into the group

## IntervalND() [3/5]

template<class T , int N>

SurgSim::Math::IntervalND< T, N >::IntervalND | ( | const IntervalND< T, N > & | interval | ) |

Copy constructor.

Parameters

  interval | interval group to copied

## IntervalND() [4/5]

template<class T , int N>

SurgSim::Math::IntervalND< T, N >::IntervalND | ( | IntervalND< T, N > && | i | ) |

Move constructor.

Parameters

  i | Interval to be copied

## IntervalND() [5/5]

template<class T , int N>

SurgSim::Math::IntervalND< T, N >::IntervalND | ( | const std::array< T, N > & | a,
|  | const std::array< T, N > & | b
| ) |  |

Constructor.

Parameters

  a | array of N values to be used as the respective minimums for the interval entries.
  b | array of N values to be used as the respective maximums for the interval entries.

## Member Function Documentation

## addThickness()

template<class T , int N>

IntervalND< T, N > & SurgSim::Math::IntervalND< T, N >::addThickness | ( | const T & | thickness | ) |

Widens every interval in the current interval group by thickness on both sides.

Parameters

  thickness | the amount to widen on both sides

Returns
  the current interval group after modification

## dotProduct()

template<class T , int N>

Interval< T > SurgSim::Math::IntervalND< T, N >::dotProduct | ( | const IntervalND< T, N > & | interval | ) | const

Parameters

  interval | the input interval group

Returns
  the interval dot product of the current group and interval

## getAxis()

template<class T , int N>

const Interval< T > & SurgSim::Math::IntervalND< T, N >::getAxis | ( | size_t | i | ) | const

Parameters

  i | the selector for the interval to be returned

Returns
  the ith interval in the current group

## inverse()

template<class T , int N>

IntervalND< T, N > SurgSim::Math::IntervalND< T, N >::inverse | ( |  | ) | const

Returns
  the inverse of each interval in the interval group

Exceptions

  if | any interval includes 0

## isApprox()

template<class T , int N>

bool SurgSim::Math::IntervalND< T, N >::isApprox | ( | const IntervalND< T, N > & | interval,
|  | const T & | epsilon
| ) |  | const

Parameters

  interval | the interval group to be tested
  epsilon | the nearness parameter

Returns
  true if each interval in the input group is approximately equal to its correspondent element in interval.

## magnitude()

template<class T , int N>

Interval< T > SurgSim::Math::IntervalND< T, N >::magnitude | ( |  | ) | const

Returns
  the interval magnitude for the current group

## magnitudeSquared()

template<class T , int N>

Interval< T > SurgSim::Math::IntervalND< T, N >::magnitudeSquared | ( |  | ) | const

Returns
  the square of the interval magnitude for the current group

## operator!=()

template<class T , int N>

bool SurgSim::Math::IntervalND< T, N >::operator!= | ( | const IntervalND< T, N > & | interval | ) | const

Parameters

  interval | the interval group to be tested

Returns
  true if the current interval group is not identical to the input group

## operator*()

template<class T , int N>

IntervalND< T, N > SurgSim::Math::IntervalND< T, N >::operator* | ( | const IntervalND< T, N > & | interval | ) | const

Standard arithmetic operators extended to interval groups

## operator*=()

template<class T , int N>

IntervalND< T, N > & SurgSim::Math::IntervalND< T, N >::operator*= | ( | const IntervalND< T, N > & | interval | ) |

Standard arithmetic operators extended to interval groups

## operator+()

template<class T , int N>

IntervalND< T, N > SurgSim::Math::IntervalND< T, N >::operator+ | ( | const IntervalND< T, N > & | interval | ) | const

Standard arithmetic operators extended to interval groups

## operator+=()

template<class T , int N>

IntervalND< T, N > & SurgSim::Math::IntervalND< T, N >::operator+= | ( | const IntervalND< T, N > & | interval | ) |

Standard arithmetic operators extended to interval groups

## operator-()

template<class T , int N>

IntervalND< T, N > SurgSim::Math::IntervalND< T, N >::operator- | ( | const IntervalND< T, N > & | interval | ) | const

Standard arithmetic operators extended to interval groups

## operator-=()

template<class T , int N>

IntervalND< T, N > & SurgSim::Math::IntervalND< T, N >::operator-= | ( | const IntervalND< T, N > & | interval | ) |

Standard arithmetic operators extended to interval groups

## operator/()

template<class T , int N>

IntervalND< T, N > SurgSim::Math::IntervalND< T, N >::operator/ | ( | const IntervalND< T, N > & | interval | ) | const

Parameters

  interval | the interval to be divided by

Returns
  the product of each interval in the group multiplied by the inverse of its correspondent in interval

Exceptions

  if | any component of interval includes 0

## operator/=()

template<class T , int N>

IntervalND< T, N > & SurgSim::Math::IntervalND< T, N >::operator/= | ( | const IntervalND< T, N > & | interval | ) |

Parameters

  interval | the interval to be divided by

Returns
  the product of each interval in the group multiplied by the inverse of its correspondent in interval

Note
  the current interval is modified by this operation

## operator=() [1/2]

template<class T , int N>

IntervalND< T, N > & SurgSim::Math::IntervalND< T, N >::operator= | ( | const IntervalND< T, N > & | interval | ) |

Assignment operator.

Parameters

  interval | Interval group to be copied

## operator=() [2/2]

template<class T , int N>

IntervalND< T, N > & SurgSim::Math::IntervalND< T, N >::operator= | ( | IntervalND< T, N > && | i | ) |

Move assignment operator.

Parameters

  i | Interval to be moved

## operator==()

template<class T , int N>

bool SurgSim::Math::IntervalND< T, N >::operator== | ( | const IntervalND< T, N > & | interval | ) | const

Parameters

  interval | the interval group to be tested

Returns
  true if the current interval group is identical to the input group

## overlapsWith()

template<class T , int N>

bool SurgSim::Math::IntervalND< T, N >::overlapsWith | ( | const IntervalND< T, N > & | interval | ) | const

Parameters

  interval | the interval group the current group will be tested against

Returns
  true if the input group interval overlaps the current group

## Member Data Documentation

## m_interval

template<class T, int N>

std::array<Interval<T>, N> SurgSim::Math::IntervalND< T, N >::m_interval

private

The N dimensional group of intervals.

The documentation for this class was generated from the following files:

- SurgSim/Math/IntervalArithmetic.h
- SurgSim/Math/IntervalArithmetic-inl.h