Public Member Functions | Private Attributes | List of all members
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
Tunderlying data type over which the interval is defined.
Nnumber 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
xarray 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
intervalinterval group to copied

◆ IntervalND() [4/5]

template<class T , int N>
SurgSim::Math::IntervalND< T, N >::IntervalND ( IntervalND< T, N > &&  i)

Move constructor.

Parameters
iInterval 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
aarray of N values to be used as the respective minimums for the interval entries.
barray 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
thicknessthe 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
intervalthe 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
ithe 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
ifany 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
intervalthe interval group to be tested
epsilonthe 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
intervalthe 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
intervalthe interval to be divided by
Returns
the product of each interval in the group multiplied by the inverse of its correspondent in interval
Exceptions
ifany 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
intervalthe 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
intervalInterval 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
iInterval to be moved

◆ operator==()

template<class T , int N>
bool SurgSim::Math::IntervalND< T, N >::operator== ( const IntervalND< T, N > &  interval) const
Parameters
intervalthe 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
intervalthe 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: