Skip to content

Add support for addition/subtraction of polynomials in the Newton basis

Damar Wicaksono requested to merge dev-140 into dev

Addition and subtraction between polynomials and polynomials as well as between polynomials and real scalar numbers are now supported for polynomials in the Newton basis via __add__() and __sub__() dunder methods. Right-sided addition and subtraction are supported for real scalar numbers as the left operand via __radd__() and __rsub__() dunder methods.

Additionally:

  • A static abstract method _iadd() is now added to the MultivariatePolynomialSingleABC as a placeholder for a concrete implementation of augmented addition (and subtraction). Currently, no concrete polynomial classes implement this method and augmented addition/subtraction will raise an exception.
  • The test suite has been extended to test the behavior of polynomial-polynomial addition/subtraction and polynomial-scalar addition/subtraction in the Newton basis.

This MR should resolve Issue #140 (closed).

Edited by Damar Wicaksono

Merge request reports

Loading