Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

PiecewisePolynomial Class Reference
[Function classes]

Piecewise polynomial curve object. More...

#include <piecewisePolynomial.h>

Inheritance diagram for PiecewisePolynomial:

PiecewiseFunction List of all members.

Public Member Functions

Constructors and Destructors
 PiecewisePolynomial () throw ()
 Default constructor.
 PiecewisePolynomial (const PiecewisePolynomial &polynomial) throw ()
 Copy constructor.
 PiecewisePolynomial (Size degree, const std::vector< Interval > &intervals, const std::vector< Coefficients > &coefficients) throw ()
 Detailed Constructor.
virtual ~PiecewisePolynomial () throw ()
 Destructor.
Assignment
PiecewisePolynomialoperator= (const PiecewisePolynomial &poly) throw ()
 Assignment operator.
virtual void clear () throw ()
 Clear method.
Accessors
void set (Size degree, const std::vector< Interval > &intervals, const std::vector< Coefficients > &coeffs) throw ()
 Set the instance manually.
void setDegree (Size degree) throw ()
 set the degree of the polynomial
Size getDegree () const throw ()
 get the degree of the polynomial
virtual double operator() (double x) const throw ()
 compute the value of the PiecewisePolynomial at a given x
Predicates
bool operator== (const PiecewisePolynomial &poly) const throw ()
 Equality operator.
Debugging and Diagnostics
virtual void dump (std::ostream &s=std::cout, Size depth=0) const throw ()
 Dumps the whole content of the object.

Protected Attributes

Size degree_

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

\[\sum_{i=0}^{d} a_i^{(k)} (x - x_0^{(k)})^i\]

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


Constructor & Destructor Documentation

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

Detailed Constructor.

This constructor does not check sanity of the arguments