Skip to content

Conversation

@brownbaerchen
Copy link
Collaborator

This PR adds a simple function for getting sparse interpolation matrices using the barycentric Lagrange interpolation that is already implemented in qmat.
It loops through every point you want to interpolate to, gathers the k nearest neighbors on the grid you interpolate from, and puts the interpolating coefficients in a line of the interpolation matrix. Afterwards, interpolation of order k can be achieved by SpMV.
For certain grids, the distances between nodes to be interpolated to and their k nearest neighbors on the grid you interpolate from repeat for multiple entries. In this case, this function will simple copy existing interpolating coefficients rather then computing them from scratch.

Tests are included that make sure the interpolation is of order k by testing that a polynomial of order k is interpolated exactly, whereas a polynomial of order k+1 is not, unless both grids match, in which case the interpolation is always exact.
The latter case is needed to test the reuse of interpolating coefficients.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c252dba) to head (dc62dde).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #17   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines         1408      1425   +17     
=========================================
+ Hits          1408      1425   +17     
Flag Coverage Δ
smart-tests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@tlunet
Copy link
Member

tlunet commented Jul 21, 2025

Thanks, looks neat 🚀

@tlunet tlunet merged commit 9a9e5f8 into Parallel-in-Time:main Jul 21, 2025
6 checks passed
@brownbaerchen brownbaerchen deleted the sparseInterpolation2 branch July 21, 2025 16:02
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.

3 participants