26 #ifndef CASADI_POLYNOMIAL_HPP
27 #define CASADI_POLYNOMIAL_HPP
29 # include "printable.hpp"
52 Polynomial(
double p0,
double p1,
double p2,
double p3);
56 Polynomial(
const std::vector<T>& coeff) : p_(coeff.begin(), coeff.end()) {}
61 auto it = p_.rbegin();
63 while (it!=p_.rend()) {
71 const std::vector<double>&
coeff()
const {
return p_; }
74 casadi_int degree()
const;
77 double scalar()
const;
89 std::string
type_name()
const {
return "Polynomial";}
92 void disp(std::ostream& stream,
bool more=
false)
const;
120 std::vector<double>
p_;
Helper class for differentiating and integrating polynomials.
const std::vector< double > & coeff() const
Coefficients of the polynomial.
std::string type_name() const
Readable name of the class.
T operator()(const T &x) const
Evaluate numerically.
Polynomial(const std::vector< T > &coeff)
Construct from a vector of polynomial coefficients.
Base class for objects that have a natural string representation.