Skip to content

Add built-in interpolation scheme using Bernstein polynomials#80

Merged
maltezfaria merged 3 commits intomainfrom
bernstein-interpolation
Mar 12, 2026
Merged

Add built-in interpolation scheme using Bernstein polynomials#80
maltezfaria merged 3 commits intomainfrom
bernstein-interpolation

Conversation

@maltezfaria
Copy link
Copy Markdown
Owner

Instead of using a global interpolation through splines (powered by Interpolations.jl as an extension), create an internal interpolation scheme based on piecewise polynomial interpolation. Summary of changes include:

  • Add src/interpolation.jl with PiecewisePolynomialInterpolation using Bernstein basis polynomials, supporting allocation-free evaluation, gradient, and Hessian via ForwardDiff
  • Add cell_extrema and proven_empty for interval arithmetic-based cell screening
  • Remove InterpolationsExt.jl extension and Interpolations.jl dependency
  • Update ReinitializationExt to use the new built-in interpolation; improve Newton solver with backtracking and best-candidate tracking
  • Add interpolation docs and mass conservation example
  • Update tests accordingly

Put together with the help of copilot and Claude based on the Bernstein polynomials present in ImplicitIntegration.jl.

…ation

- Add `src/interpolation.jl` with `PiecewisePolynomialInterpolation` using
  Bernstein basis polynomials, supporting allocation-free evaluation,
  gradient, and Hessian via ForwardDiff
- Add `cell_extrema` and `proven_empty` for interval arithmetic-based cell
  screening
- Remove `InterpolationsExt.jl` extension and `Interpolations.jl` dependency
- Update `ReinitializationExt` to use the new built-in interpolation;
  improve Newton solver with backtracking and best-candidate tracking
- Add interpolation docs and mass conservation example
- Update tests accordingly
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 89.56044% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.23%. Comparing base (52c703d) to head (cdad6a2).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/interpolation.jl 87.21% 17 Missing ⚠️
ext/ReinitializationExt.jl 97.91% 1 Missing ⚠️
src/LevelSetMethods.jl 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (52c703d) and HEAD (cdad6a2). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (52c703d) HEAD (cdad6a2)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #80       +/-   ##
===========================================
- Coverage   83.29%   62.23%   -21.06%     
===========================================
  Files          16       16               
  Lines        1161     1279      +118     
===========================================
- Hits          967      796      -171     
- Misses        194      483      +289     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maltezfaria maltezfaria merged commit 4c664b9 into main Mar 12, 2026
6 checks passed
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