Fix Issue #27 - Zero-degree MultiIndexSet and constant polynomials.
This is a proposed fix for Issue #27 (closed) about creating a multi-index set with a degree zero (for constant polynomials).
Some additional changes:
- The DDS results in the 'interpolate' function should not be squeezed but instead reshaped because degree-zero polynomial have DDS results of shape (1,1).
- The unit test has been expanded to cover case with zero PolyDegree. Some tests do not apply for zero PolyDegree, e.g., removing exponent row; the tests are modified specifically for these cases.
Some of the tests (when adding and subtracting two zero-degree Lagrange polynomials), however, now throws a warning that didn't appear before.
...src\minterpy\core\verification.py:323: UserWarning: the smallest encountered value in the given points is 0.0 (expected -1.0). this may lead to unexpected behaviour, e.g. rank deficiencies in the regression matrices, etc. .
This is coming from the function check_domain_fit
in the core/verification.py
. Basically it warns about the generating values do not span [-1, 1] which I guess makes sense because zero-degree polynomials have only one generating value.
Maybe some other tests not yet covered can be devised to further check the behavior of constant polynomials?
Edited by Damar Wicaksono