Refactor Polynomial-Polynomial Addition/Subtraction in the Newton Basis
Following recent changes in the MultiIndexSet
(see Issue #99 (closed)) and Grid
(see Issue #135) classes, the implementation of polynomial-polynomial multiplication in the Newton basis shall be refactored.
The logic behind the multiplication is as follows: Given two polynomials in the Newton basis
- Verify the type, length, and dimension of the operands; match their dimension if necessary
- Add the underlying
Grid
instances (rely on the method of unionizing twoGrid
instances; see Issue #155 (closed)) - Add the underlying
MultiIndexSet
instances if they are not the same as the one attached to the respective instances (this is related to the notion "separate indices"). Adding twoMultiIndexSet
instances rely on the union method (see Issue #124 (closed)) - Process the coefficients; compute the values of the two polynomial operands at the unisolvent nodes associated with the union grid, sum them up to obtain the Lagrange coefficients of the summed polynomial, and transform these coefficients into Newton coefficients.
- Create a new instance of polynomial with the new
Grid
instance, coefficients, and (when applicable)MultiIndexSet
instance.
This issue is part of extending the support for arithmetic operations involving polynomial (see Issue #142 (closed)).