List of all members | Public Member Functions | Protected Attributes
casadi::Polynomial Class Reference

Helper class for differentiating and integrating polynomials. More...

#include <polynomial.hpp>

Detailed Description

Author
Joel Andersson
Date
2014

Extra doc: https://github.com/casadi/casadi/wiki/L_8y

Definition at line 39 of file polynomial.hpp.

Inheritance diagram for casadi::Polynomial:
Inheritance graph
[legend]

Public Member Functions

 Polynomial (double scalar=1)
 Construct a constant polynomial. More...
 
 Polynomial (double p0, double p1)
 Construct a linear polynomial. More...
 
 Polynomial (double p0, double p1, double p2)
 Construct a quadratic polynomial. More...
 
 Polynomial (double p0, double p1, double p2, double p3)
 Construct a cubic polynomial. More...
 
template<typename T >
 Polynomial (const std::vector< T > &coeff)
 Construct from a vector of polynomial coefficients. More...
 
template<typename T >
operator() (const T &x) const
 Evaluate numerically. More...
 
const std::vector< double > & coeff () const
 Coefficients of the polynomial. More...
 
casadi_int degree () const
 Degree of the polynomial. More...
 
double scalar () const
 Get scalar value (error if degree()!=0) More...
 
Polynomial derivative () const
 Create a new polynomial for the derivative. More...
 
Polynomial anti_derivative () const
 Create a new polynomial for the anti-derivative (primitive function) More...
 
void trim ()
 Remove excess zeros. More...
 
std::string type_name () const
 Readable name of the class. More...
 
void disp (std::ostream &stream, bool more=false) const
 Print a description of the object. More...
 
Polynomial operator+ (const Polynomial &b) const
 
Polynomialoperator+= (const Polynomial &b)
 
Polynomial operator- (const Polynomial &b) const
 
Polynomialoperator-= (const Polynomial &b)
 
Polynomial operator* (const Polynomial &b) const
 
Polynomialoperator*= (const Polynomial &b)
 
Polynomial operator/ (double b) const
 
Polynomialoperator/= (double b)
 

Protected Attributes

std::vector< double > p_
 

Constructor & Destructor Documentation

◆ Polynomial() [1/5]

casadi::Polynomial::Polynomial ( double  scalar = 1)

◆ Polynomial() [2/5]

casadi::Polynomial::Polynomial ( double  p0,
double  p1 
)

◆ Polynomial() [3/5]

casadi::Polynomial::Polynomial ( double  p0,
double  p1,
double  p2 
)

◆ Polynomial() [4/5]

casadi::Polynomial::Polynomial ( double  p0,
double  p1,
double  p2,
double  p3 
)

◆ Polynomial() [5/5]

template<typename T >
casadi::Polynomial::Polynomial ( const std::vector< T > &  coeff)
inline

Definition at line 56 of file polynomial.hpp.

Member Function Documentation

◆ anti_derivative()

Polynomial casadi::Polynomial::anti_derivative ( ) const

◆ coeff()

const std::vector<double>& casadi::Polynomial::coeff ( ) const
inline

Definition at line 71 of file polynomial.hpp.

◆ degree()

casadi_int casadi::Polynomial::degree ( ) const

◆ derivative()

Polynomial casadi::Polynomial::derivative ( ) const

◆ disp()

void casadi::Polynomial::disp ( std::ostream &  stream,
bool  more = false 
) const

◆ operator()()

template<typename T >
T casadi::Polynomial::operator() ( const T &  x) const
inline

Definition at line 60 of file polynomial.hpp.

◆ operator*()

Polynomial casadi::Polynomial::operator* ( const Polynomial b) const

◆ operator*=()

Polynomial& casadi::Polynomial::operator*= ( const Polynomial b)

◆ operator+()

Polynomial casadi::Polynomial::operator+ ( const Polynomial b) const

◆ operator+=()

Polynomial& casadi::Polynomial::operator+= ( const Polynomial b)

◆ operator-()

Polynomial casadi::Polynomial::operator- ( const Polynomial b) const

◆ operator-=()

Polynomial& casadi::Polynomial::operator-= ( const Polynomial b)

◆ operator/()

Polynomial casadi::Polynomial::operator/ ( double  b) const

◆ operator/=()

Polynomial& casadi::Polynomial::operator/= ( double  b)

◆ scalar()

double casadi::Polynomial::scalar ( ) const

◆ trim()

void casadi::Polynomial::trim ( )

◆ type_name()

std::string casadi::Polynomial::type_name ( ) const
inline

Definition at line 89 of file polynomial.hpp.

Member Data Documentation

◆ p_

std::vector<double> casadi::Polynomial::p_
protected

Definition at line 120 of file polynomial.hpp.


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