opensurgsim
Public Member Functions | List of all members
SurgSim::Math::Polynomial< T, 0 > Class Template Reference

Polynomial<T, 0> specializes the Polynomial class for degree 0 (constant polynomials) More...

#include <Polynomial.h>

Public Member Functions

 Polynomial ()
 Constructor.
 
 Polynomial (const T &a0)
 Constructor. More...
 
evaluate (const T &x) const
 Evaluate the polynomial at a point. More...
 
operator() (const T &x) const
 Evaluate the polynomial at a point. More...
 
bool isNearZero (const T &epsilon=static_cast< T >(polynomial_epsilon)) const
 
bool isApprox (const Polynomial< T, 0 > &p, const T &epsilon) const
 
getCoefficient (size_t i) const
 
void setCoefficient (size_t i, const T &value)
 Set a specified coefficient to a desired value. More...
 
T & operator[] (const size_t i)
 
const T & operator[] (const size_t i) const
 
Polynomial< T, 0 > operator- () const
 
Polynomial< T, 0 > operator+ (const Polynomial< T, 0 > &rhs) const
 
Polynomial< T, 0 > & operator+= (const Polynomial< T, 0 > &rhs)
 
Polynomial< T, 0 > operator- (const Polynomial< T, 0 > &rhs) const
 
Polynomial< T, 0 > & operator-= (const Polynomial< T, 0 > &rhs)
 

Detailed Description

template<typename T>
class SurgSim::Math::Polynomial< T, 0 >

Polynomial<T, 0> specializes the Polynomial class for degree 0 (constant polynomials)

See also
Polynomial<T, N>

Constructor & Destructor Documentation

§ Polynomial()

template<class T >
SurgSim::Math::Polynomial< T, 0 >::Polynomial ( const T &  a0)
explicit

Constructor.

Parameters
a0coefficient of the 0 degree term

Member Function Documentation

§ evaluate()

template<class T >
T SurgSim::Math::Polynomial< T, 0 >::evaluate ( const T &  x) const

Evaluate the polynomial at a point.

Parameters
xpoint at which to evaluate the polynomial
Returns
the value of the polynomial at x

§ getCoefficient()

template<class T >
T SurgSim::Math::Polynomial< T, 0 >::getCoefficient ( size_t  i) const
Parameters
iindex of the desired coefficient
Returns
the value of coefficient i

§ isApprox()

template<class T >
bool SurgSim::Math::Polynomial< T, 0 >::isApprox ( const Polynomial< T, 0 > &  p,
const T &  epsilon 
) const
Parameters
pthe test polynomial
epsilonthe closeness parameter
Returns
true if all the coefficients of the current polynomial are within an epsilon of the corresponding coefficient in p

§ isNearZero()

template<class T >
bool SurgSim::Math::Polynomial< T, 0 >::isNearZero ( const T &  epsilon = static_cast<T>(polynomial_epsilon)) const
Parameters
epsilonthe closeness parameter
Returns
true if all coefficients of the polynomial are within an epsilon of 0

§ operator()()

template<class T >
T SurgSim::Math::Polynomial< T, 0 >::operator() ( const T &  x) const

Evaluate the polynomial at a point.

Parameters
xpoint at which to evaluate the polynomial
Returns
the value of the polynomial at x

§ operator[]()

template<class T >
T & SurgSim::Math::Polynomial< T, 0 >::operator[] ( const size_t  i)

Standard arithmetic operators extended to intervals

§ setCoefficient()

template<class T >
void SurgSim::Math::Polynomial< T, 0 >::setCoefficient ( size_t  i,
const T &  value 
)

Set a specified coefficient to a desired value.

Parameters
iindex of the desired coefficient
valuethe value to be set in the coefficient
Exceptions
ifi is greater than the polynomial degree

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