Skip to content

Conversation

@maltezfaria
Copy link
Contributor

  • Fixes a bug on the Free boundary condition for Cubic interpolation, which was previously just a copy-past of the periodic boundary conditions.
  • Adds some tests that cubic interpolation should be exact for cubic polynomials when using the free boundary condition.

Should close #594 (and possibly #570?).

@maltezfaria
Copy link
Contributor Author

The CI failure seems to be unrelated to the changes in this PR. Not sure how to go about it though (change the broken tests in master to @test_broken?).

@maltezfaria
Copy link
Contributor Author

And here is an visual example of the effect of the BC when running this code:

using Interpolations, CairoMakie
ix = 1:10
f = x -> x^3 - 2x^2 - 1
A = map(f, ix)
itp = interpolate(A, BSpline(Cubic(Free(OnGrid()))))
xx = 1:0.01:10 |> collect
fig, ax, pl = lines(xx, f; color = :black, label = "original", linestyle = :solid, linewidth = 2)
lines!(ax, xx, map(itp, xx); color = :blue, label = "interpolated", linestyle = :dash, linewidth = 2)
axislegend(ax, position = :lt)

master

iterpolation_old

PR

iterpolation_new

@mkitti
Copy link
Collaborator

mkitti commented Apr 20, 2025

Watching ...

@ajwheeler
Copy link
Contributor

CI failures should be fixed after #614 and #615 are merged. Confirmed that the tests failing here are the same ones failing on master.

@mkitti
Copy link
Collaborator

mkitti commented Apr 21, 2025

I just merged the above two pull requests. I'll come back to this after those changes settle in. It does not appear there are any conflicts between this PR and what I just merged.

@maltezfaria
Copy link
Contributor Author

@mkitti thanks! Let me know if you need a rebase at some point.

@mkitti mkitti merged commit 0b0e7e8 into JuliaMath:master Apr 30, 2025
2 of 11 checks passed
@mkitti
Copy link
Collaborator

mkitti commented Apr 30, 2025

Thank you. Sorry for the delay.

@maltezfaria
Copy link
Contributor Author

Thank you. Sorry for the delay.

Thanks!

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.

Incorrect boundary conditions for Cubic{Free} ?

3 participants