-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/JuliaMath/Interpolations.jl
- Loading branch information
Showing
8 changed files
with
184 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
@testset "Periodic extrapolation" begin | ||
xmax = 7 | ||
f(x) = sin((x-3)*2pi/xmax - 1) | ||
A = Float64[f(x) for x in 1:xmax] # Does not include the periodic image | ||
|
||
itp0 = interpolate(A, BSpline(Constant(Periodic()))) | ||
itp1 = interpolate(A, BSpline(Linear(Periodic()))) | ||
itp2 = interpolate(A, BSpline(Quadratic(Periodic(OnCell())))) | ||
itp3 = interpolate(A, BSpline(Cubic(Periodic(OnCell())))) | ||
|
||
etp0 = extrapolate(itp0, Periodic()) | ||
etp1 = extrapolate(itp1, Periodic()) | ||
etp2 = extrapolate(itp2, Periodic()) | ||
etp3 = extrapolate(itp3, Periodic()) | ||
|
||
for x in -xmax:.4:2*xmax | ||
@test etp0(x) ≈ f(x) atol=0.5 | ||
@test etp1(x) ≈ f(x) atol=0.1 | ||
@test etp2(x) ≈ f(x) atol=0.01 | ||
@test etp3(x) ≈ f(x) atol=0.003 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,4 +107,5 @@ using Test | |
|
||
include("type-stability.jl") | ||
include("non1.jl") | ||
include("periodic.jl") | ||
end |
c5bd734
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
c5bd734
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/39874
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: