Skip to content

Faster differentiation of polynomials in the Newton basis.

Damar Wicaksono requested to merge dev-diff into dev

The differentiation of polynomials in the Newton basis is now faster due to proper implementation in Numba. The method diff() and partial_diff() of NewtonPolynomial now accepts an optional keyword-only argument backend which has three supported values in string:

  • "numpy": differentiation using the NumPy implementation (the current, before merging this commit).
  • "numba": differentiation using the JIT-ted code with the help of Numba; this is now the default implementation when differentiation is carried out.
  • "numba-par": differentation using the parallelized (CPU) JIT-ted code with the help of Numba; this implementation may accelerate further the differentiation for large problem sizes.

This MR should resolve Issue #96.

Several additional changes:

  • Common functionalities that are provided by Python or NumPy (e.g., combinations() from the itertools module) that cannot be used inside a JIT-ted code are reimplemented.
  • Tests related to the differentiation are refactored using class-based organization.
  • Docstrings of all relevant functions are updated and the corresponding Sphinx docs are adjusted accordingly.

Merge request reports