0.2.0
Loading...
Searching...
No Matches
NAV::Polynomial< Scalar > Class Template Reference

Polynomial. More...

Public Member Functions

const Eigen::VectorX< Scalar > & coeffs () const
 Returns the coefficients.
 
Scalar f (Scalar x) const
 Calculates the polynomial value at given x.
 
Polynomial< Scalar > getDerivative () const
 Calculates the derivative of the polynomial.
 
template<typename Derived >
 Polynomial (const Eigen::DenseBase< Derived > &coefficients)
 Constructor.
 
std::string toString (fmt::format_string< double > fmt="{:.1e}", const char *var="x") const
 Format the polynomial as a string.
 

Detailed Description

template<typename Scalar>
class NAV::Polynomial< Scalar >

Polynomial.

Constructor & Destructor Documentation

◆ Polynomial()

template<typename Scalar >
template<typename Derived >
NAV::Polynomial< Scalar >::Polynomial ( const Eigen::DenseBase< Derived > & coefficients)
inline

Constructor.

Parameters
coefficientsPolynomial coefficients in order a0 + a1 * x + a2 * x^2 + ...

Member Function Documentation

◆ f()

template<typename Scalar >
Scalar NAV::Polynomial< Scalar >::f ( Scalar x) const
inline

Calculates the polynomial value at given x.

Parameters
xX value

◆ toString()

template<typename Scalar >
std::string NAV::Polynomial< Scalar >::toString ( fmt::format_string< double > fmt = "{:.1e}",
const char * var = "x" ) const
inline

Format the polynomial as a string.

Parameters
[in]fmtFormat string for the polynomial coefficients
[in]varVariable name to use

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