opensurgsim
Public Member Functions | Friends | List of all members
SurgSim::Math::IntervalND< T, 3 > Class Template Reference

IntervalND<T,3> defines the concept of a group of mathematical intervals specialized to 3 intervals and provides operations on them including arithmetic operations, construction, and IO. More...

#include <IntervalArithmetic.h>

Public Member Functions

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

Friends

template<class P >
void IntervalArithmetic_add (const IntervalND< P, 3 > &a, const IntervalND< P, 3 > &b, IntervalND< P, 3 > *res)
 Calculate the sum of two interval groups. More...
 
template<class P >
void IntervalArithmetic_sub (const IntervalND< P, 3 > &a, const IntervalND< P, 3 > &b, IntervalND< P, 3 > *res)
 Calculate the difference of two interval groups. More...
 
template<class P >
void IntervalArithmetic_crossProduct (const IntervalND< P, 3 > &a, const IntervalND< P, 3 > &b, IntervalND< P, 3 > *res)
 Calculate the cross product of two interval groups. More...
 
template<class P >
void IntervalArithmetic_dotProduct (const IntervalND< P, 3 > &a, const IntervalND< P, 3 > &b, Interval< P > *res)
 Calculate the dot product of two interval groups. More...
 

Detailed Description

template<class T>
class SurgSim::Math::IntervalND< T, 3 >

IntervalND<T,3> defines the concept of a group of mathematical intervals specialized to 3 intervals and provides operations on them including arithmetic operations, construction, and IO.

Template Parameters
Tunderlying data type over which the interval is defined.
See also
Interval<T> and IntervalND<T, N>

Constructor & Destructor Documentation

§ IntervalND() [1/5]

template<class T >
SurgSim::Math::IntervalND< T, 3 >::IntervalND ( const std::array< Interval< T >, 3 > &  x)
explicit

Constructor.

Parameters
xarray of 3 intervals to be copied into the group

§ IntervalND() [2/5]

template<class T >
SurgSim::Math::IntervalND< T, 3 >::IntervalND ( const Interval< T > &  x,
const Interval< T > &  y,
const Interval< T > &  z 
)

Constructor.

Parameters
xfirst interval to be added to the 3 group
ysecond interval to be added to the 3 group
zthird interval to be added to the 3 group

§ IntervalND() [3/5]

template<class T >
SurgSim::Math::IntervalND< T, 3 >::IntervalND ( const IntervalND< T, 3 > &  i)

Copy constructor.

Parameters
iinterval 3 group to copied

§ IntervalND() [4/5]

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

Move constructor.

Parameters
iInterval to be copied

§ IntervalND() [5/5]

template<class T >
SurgSim::Math::IntervalND< T, 3 >::IntervalND ( const std::array< T, 3 > &  a,
const std::array< T, 3 > &  b 
)

Constructor.

Parameters
aarray of 3 values to be used as the respective minimums for the interval entries.
barray of 3 values to be used as the respective maximums for the interval entries.

Member Function Documentation

§ addThickness()

template<class T >
IntervalND< T, 3 > & SurgSim::Math::IntervalND< T, 3 >::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

§ crossProduct()

template<class T >
IntervalND< T, 3 > SurgSim::Math::IntervalND< T, 3 >::crossProduct ( const IntervalND< T, 3 > &  i) const
Parameters
ithe input interval group
Returns
the interval cross product of the current 3 group and interval

§ dotProduct()

template<class T >
Interval< T > SurgSim::Math::IntervalND< T, 3 >::dotProduct ( const IntervalND< T, 3 > &  i) const
Parameters
ithe input interval group
Returns
the interval dot product of the current 3 group and interval

§ getAxis()

template<class T >
const Interval< T > & SurgSim::Math::IntervalND< T, 3 >::getAxis ( size_t  i) const
Parameters
ithe selector for the interval to be returned
Returns
the ith interval in the current 3 group

§ inverse()

template<class T >
IntervalND< T, 3 > SurgSim::Math::IntervalND< T, 3 >::inverse ( ) const
Returns
the inverse of each interval in the 3 interval group
Exceptions
ifany interval includes 0

§ isApprox()

template<class T >
bool SurgSim::Math::IntervalND< T, 3 >::isApprox ( const IntervalND< T, 3 > &  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 >
Interval< T > SurgSim::Math::IntervalND< T, 3 >::magnitude ( ) const
Returns
the interval magnitude for the current 3 group

§ magnitudeSquared()

template<class T >
Interval< T > SurgSim::Math::IntervalND< T, 3 >::magnitudeSquared ( ) const
Returns
the square of the interval magnitude for the current 3 group

§ operator!=()

template<class T >
bool SurgSim::Math::IntervalND< T, 3 >::operator!= ( const IntervalND< T, 3 > &  i) const
Parameters
ithe interval group to be tested
Returns
true if the current interval 3 group is not identical to the input 3 group i

§ operator+()

template<class T >
IntervalND< T, 3 > SurgSim::Math::IntervalND< T, 3 >::operator+ ( const IntervalND< T, 3 > &  i) const

Standard arithmetic operators extended to 3 interval groups

§ operator/()

template<class T >
IntervalND< T, 3 > SurgSim::Math::IntervalND< T, 3 >::operator/ ( const IntervalND< T, 3 > &  i) const
Parameters
ithe interval to be divided by
Returns
the product of each interval in the 3 group multiplied by the inverse of its correspondent in i
Exceptions
ifany component of interval includes 0

§ operator/=()

template<class T >
IntervalND< T, 3 > & SurgSim::Math::IntervalND< T, 3 >::operator/= ( const IntervalND< T, 3 > &  i)
Parameters
ithe interval to be divided by
Returns
the product of each interval in the 3 group multiplied by the inverse of its correspondent in i
Note
the current interval is modified by this operation

§ operator=() [1/2]

template<class T >
IntervalND< T, 3 > & SurgSim::Math::IntervalND< T, 3 >::operator= ( const IntervalND< T, 3 > &  i)

Assignment operator.

Parameters
iInterval 3 group to be copied

§ operator=() [2/2]

template<class T >
IntervalND< T, 3 > & SurgSim::Math::IntervalND< T, 3 >::operator= ( IntervalND< T, 3 > &&  i)

Move assignment operator.

Parameters
iInterval to be moved

§ operator==()

template<class T >
bool SurgSim::Math::IntervalND< T, 3 >::operator== ( const IntervalND< T, 3 > &  i) const
Parameters
ithe interval group to be tested
Returns
true if the current interval 3 group is identical to the input 3 group i

§ overlapsWith()

template<class T >
bool SurgSim::Math::IntervalND< T, 3 >::overlapsWith ( const IntervalND< T, 3 > &  interval) const
Parameters
intervalthe interval group the current group will be tested against
Returns
true if the input 3 group interval overlaps the current 3 group

Friends And Related Function Documentation

§ IntervalArithmetic_add

template<class T >
template<class P >
void IntervalArithmetic_add ( const IntervalND< P, 3 > &  a,
const IntervalND< P, 3 > &  b,
IntervalND< P, 3 > *  res 
)
friend

Calculate the sum of two interval groups.

Template Parameters
Punderlying type of the interval
Parameters
athe first interval group
bthe second interval group
res[out] the result of a + b

§ IntervalArithmetic_crossProduct

template<class T >
template<class P >
void IntervalArithmetic_crossProduct ( const IntervalND< P, 3 > &  a,
const IntervalND< P, 3 > &  b,
IntervalND< P, 3 > *  res 
)
friend

Calculate the cross product of two interval groups.

Template Parameters
Punderlying type of the interval
Parameters
athe first interval group
bthe second interval group
res[out] the cross product of a and b

§ IntervalArithmetic_dotProduct

template<class T >
template<class P >
void IntervalArithmetic_dotProduct ( const IntervalND< P, 3 > &  a,
const IntervalND< P, 3 > &  b,
Interval< P > *  res 
)
friend

Calculate the dot product of two interval groups.

Template Parameters
Punderlying type of the interval
Parameters
athe first interval group
bthe second interval group
res[out] the dot product of a and b

§ IntervalArithmetic_sub

template<class T >
template<class P >
void IntervalArithmetic_sub ( const IntervalND< P, 3 > &  a,
const IntervalND< P, 3 > &  b,
IntervalND< P, 3 > *  res 
)
friend

Calculate the difference of two interval groups.

Template Parameters
Punderlying type of the interval
Parameters
athe first interval group
bthe second interval group
res[out] the result of a - b

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