Represents a polynomial function.
std::shared_ptr< Function > m_derivative
The function representing the derivative (uses lazy initialization)
std::shared_ptr< Function > indefiniteIntegral() const override
Returns the indefinite integral of the polynomial.
std::shared_ptr< Function > m_indefIntegral
The function representing the indefinite integral (uses lazy initialization)
Polynomial(std::vector< double > coefficients)
std::vector< double > m_coef
The vector where the polynomial coefficients are stored.
double operator()(const double) const override
Calculates the value of the polynomial for the given value.
std::unique_ptr< Function > clone() const override
Creates a new polynomial with the same coefficients.
std::shared_ptr< Function > derivative() const override
Returns the derivative of the polynomial.
const std::vector< double > & getCoefficients() const
Returns the coefficients of the polynomial.
std::array< std::vector< double >, N > Coordinates
Used to pass the grid coordinates to interpn. Internally will make a copy of the required values.