Skip to content

[Lang] [test] Add polynomial series and basis matrix evaluators#8790

Open
yunusberndt wants to merge 4 commits intotaichi-dev:masterfrom
yunusberndt:pr-basis-functions
Open

[Lang] [test] Add polynomial series and basis matrix evaluators#8790
yunusberndt wants to merge 4 commits intotaichi-dev:masterfrom
yunusberndt:pr-basis-functions

Conversation

@yunusberndt
Copy link
Copy Markdown

@yunusberndt yunusberndt commented Mar 20, 2026

Issue: N/A

Brief Summary

  • Add polynomial series evaluators to taichi.math.polynomial.
  • Add basis-matrix constructors and NumPy-reference parity tests.

Walkthrough

  • Added series evaluators: lagval, hermval, chebval, legval, polyval, fourval.
  • Added matrix builders: lagmatrix, hermmatrix, chebmatrix, legmatrix, polymatrix, fourmatrix.
  • Added NumPy reference helpers in tests/python/basis_functions_ref.py.
  • Added tests:
    • tests/python/test_basis_series_eval.py
    • tests/python/test_basis_matrices_eval.py
  • Local validation:
    • python tests/run_tests.py test_basis_series_eval -a cpu -t1 -s
    • python tests/run_tests.py test_basis_matrices_eval -a cpu -t1 -s

Note

Medium Risk
Adds new public taichi.math polynomial evaluation APIs and matrix constructors; main risk is numerical correctness/edge cases and potential kernel performance impacts rather than security.

Overview
Adds a new taichi.math.polynomial module (re-exported via taichi.math) providing in-kernel, in-place evaluators for multiple polynomial/Fourier series (lagval, hermval, chebval, legval, polyval, fourval).

Also adds in-place constructors for corresponding (pseudo-)Vandermonde/design matrices (lagmatrix, hermmatrix, chebmatrix, legmatrix, polymatrix, fourmatrix), including optional orthogonality weights where applicable.

Introduces NumPy reference implementations and parity tests for both series evaluation and matrix construction across f32 and f64.

Written by Cursor Bugbot for commit ff0ffec. This will update automatically on new commits. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant