ContRap-Libraries
|
Class RealPolynomial represents a polynomial function over the reals. More...
#include <functions.h>
Public Member Functions | |
RealPolynomial (const std::vector< double > &coefficients=std::vector< double >()) | |
Creates a polynomial from coefficients. | |
virtual | ~RealPolynomial () |
Virtual destructor. | |
virtual double | operator() (double x) |
Evaluates the function at a given point. | |
std::vector< double > & | get_coefficients () |
Returns the coefficients vector. | |
void | set_coefficients (std::vector< double > &coefficients) |
Sets the coefficients vector by making a copy. | |
int | get_max_degree () |
Returns the maximal degree of the polynomial. | |
Protected Attributes | |
std::vector< double > | coefficients |
Coefficients in ascending order. |
Class RealPolynomial represents a polynomial function over the reals.
crp::RealPolynomial::RealPolynomial | ( | const std::vector< double > & | coefficients = std::vector< double >() | ) |
Creates a polynomial from coefficients.
coefficients | Array of coefficients in ascending order |
virtual crp::RealPolynomial::~RealPolynomial | ( | ) | [inline, virtual] |
Virtual destructor.
std::vector<double>& crp::RealPolynomial::get_coefficients | ( | ) |
Returns the coefficients vector.
int crp::RealPolynomial::get_max_degree | ( | ) | [inline] |
Returns the maximal degree of the polynomial.
virtual double crp::RealPolynomial::operator() | ( | double | x | ) | [virtual] |
Evaluates the function at a given point.
x | Evaluation point |
Implements crp::RealFunction.
void crp::RealPolynomial::set_coefficients | ( | std::vector< double > & | coefficients | ) |
Sets the coefficients vector by making a copy.
coefficients | Vector of coefficients |
std::vector<double> crp::RealPolynomial::coefficients [protected] |
Coefficients in ascending order.