40 if (coefficients.size() == 0) {
87 for (std::size_t j = 0; j <= poly.
maxXorder_m; j ++) {
88 newPoly[i + j] = newPoly[i + j] +
112 for (std::size_t i = 0; i <= poly.
maxXorder_m; i++) {
118 const std::size_t &order) {
void multiplyPolynomial(const Polynomial &poly)
Multiply polynomial with input polynomial by multiplying term by term maxXorder_m is adjusted accord...
~Polynomial()
Destructor, does nothing.
void addPolynomial(const Polynomial &poly)
Add polynomial to input polynomial If input polynomial has higher order terms, then maxXorder_m is a...
std::vector< int > coefficients_m
Polynomial()
Default constructor, initialises zero polynomial.
double evaluatePolynomial(const double &x) const
Evaluate the polynomial.
void printPolynomial() const
Print polynomial for internal debugging.
void setCoefficient(const int &coefficient, const std::size_t &order)
Set the coefficient in front of x^order If order is larger than maxXorder_m maxXorder_m is adjusted ...
void differentiatePolynomial()
Differentiate polynomial using .
void setZero()
Set polynomial to zero.
Polynomial & operator=(const Polynomial &poly)
Assigment operator.