Loading...
Searching...
No Matches
BALL::PiecewisePolynomial Class Reference
Foundation Classes » Mathematics » Function classes

`#include <BALL/MATHS/piecewisePolynomial.h>`

Inheritance diagram for BALL::PiecewisePolynomial:

## Public Member Functions

Constructors and Destructors
| PiecewisePolynomial ()
| PiecewisePolynomial (const PiecewisePolynomial &polynomial)
| PiecewisePolynomial (Size degree, const std::vector< Interval > &intervals, const std::vector< Coefficients > &coefficients)
virtual | ~PiecewisePolynomial ()
Assignment
PiecewisePolynomial & | operator= (const PiecewisePolynomial &poly)
virtual void | clear ()
Accessors
void | set (Size degree, const std::vector< Interval > &intervals, const std::vector< Coefficients > &coeffs)
void | setDegree (Size degree)
| set the degree of the polynomial
Size | getDegree () const
| get the degree of the polynomial
virtual double | operator() (double x) const
| compute the value of the PiecewisePolynomial at a given x
Predicates
bool | operator== (const PiecewisePolynomial &poly) const
Public Member Functions inherited from BALL::PiecewiseFunction
| PiecewiseFunction ()
| PiecewiseFunction (const PiecewiseFunction &function)
| PiecewiseFunction (const std::vector< Interval > &intervals, const std::vector< Coefficients > &coeffs)
virtual | ~PiecewiseFunction ()
PiecewiseFunction & | operator= (const PiecewiseFunction &function)
void | clear ()
void | setIntervals (const std::vector< Interval > &intervals)
const std::vector< Interval > & | getIntervals () const
const Interval & | getInterval (double x) const
const Interval & | getInterval (Position index) const
Position | getIntervalIndex (double x) const
const Interval & | getRange () const
void | setCoefficients (const vector< Coefficients > &coefficients)
const std::vector< Coefficients > & | getCoefficients () const
const Coefficients & | getCoefficients (double x) const
const Coefficients & | getCoefficients (Position index) const
void | set (const std::vector< Interval > &intervals, const std::vector< Coefficients > &coeffs)
bool | isInRange (double x) const
virtual bool | isValid () const
bool | operator== (const PiecewiseFunction &function) const

## Debugging and Diagnostics

Size | degree_
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const

## Additional Inherited Members

std::vector< Interval > | intervals_
std::vector< Coefficients > | coefficients_
bool | valid_

## Detailed Description

Piecewise polynomial curve object. This class provides a trivial implementation of piecewise polynomial curves. More useful spline/B-spline implementations might follow in the future. The PPCurves are of the form

, where is the index of the interval and is the overall degree of the PPCurve. Note that there is no warranty that the defined curve is continuously differentiable or even continuous.

Definition at line 27 of file piecewisePolynomial.h.

## Constructor & Destructor Documentation

## PiecewisePolynomial() [1/3]

BALL::PiecewisePolynomial::PiecewisePolynomial | ( |  | ) |

Default constructor

## PiecewisePolynomial() [2/3]

BALL::PiecewisePolynomial::PiecewisePolynomial | ( | const PiecewisePolynomial & | polynomial | ) |

Copy constructor

## PiecewisePolynomial() [3/3]

BALL::PiecewisePolynomial::PiecewisePolynomial | ( | Size | degree,
|  | const std::vector< Interval > & | intervals,
|  | const std::vector< Coefficients > & | coefficients )

Detailed Constructor. This constructor does not check sanity of the arguments

## ~PiecewisePolynomial()

virtual BALL::PiecewisePolynomial::~PiecewisePolynomial | ( |  | ) |

virtual

Destructor

## Member Function Documentation

## clear()

virtual void BALL::PiecewisePolynomial::clear | ( |  | ) |

virtual

Clear method

## dump()

virtual void BALL::PiecewisePolynomial::dump | ( | std::ostream & | s = std::cout,
|  | Size | depth = 0 ) const

virtual

Dumps the whole content of the object

Reimplemented from BALL::PiecewiseFunction.

## getDegree()

Size BALL::PiecewisePolynomial::getDegree | ( |  | ) | const

get the degree of the polynomial

## operator()()

virtual double BALL::PiecewisePolynomial::operator() | ( | double | x | ) | const

virtual

compute the value of the PiecewisePolynomial at a given x

Reimplemented from BALL::PiecewiseFunction.

## operator=()

PiecewisePolynomial & BALL::PiecewisePolynomial::operator= | ( | const PiecewisePolynomial & | poly | ) |

Assignment operator

## operator==()

bool BALL::PiecewisePolynomial::operator== | ( | const PiecewisePolynomial & | poly | ) | const

Equality operator

## set()

void BALL::PiecewisePolynomial::set | ( | Size | degree,
|  | const std::vector< Interval > & | intervals,
|  | const std::vector< Coefficients > & | coeffs )

Set the instance manually

## setDegree()

void BALL::PiecewisePolynomial::setDegree | ( | Size | degree | ) |

set the degree of the polynomial

## Member Data Documentation

## degree_

Size BALL::PiecewisePolynomial::degree_

protected

Definition at line 111 of file piecewisePolynomial.h.