25 #ifndef MATHUTILS_POLYNOMIAL_H 26 #define MATHUTILS_POLYNOMIAL_H 54 explicit Polynomial(std::vector<double> coefficients);
60 const std::vector<double>& getCoefficients()
const;
63 double operator()(
const double)
const override;
66 std::unique_ptr<Function> clone()
const override;
69 std::shared_ptr<Function>
derivative()
const override;
72 std::shared_ptr<Function> indefiniteIntegral()
const override;
79 mutable std::shared_ptr<Function> m_derivative {};
81 mutable std::shared_ptr<Function> m_indefIntegral {};
std::vector< double > m_coef
The vector where the polynomial coefficients are stored.
Interface representing a differentiable function.
Represents a polynomial function.
double derivative(const Function &f, const double x)