Skip to content

Commit

Permalink
test(CubicSpline): add tests for AbstractMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh-b-b committed Oct 7, 2024
1 parent e3406e5 commit b9637bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/interpolation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,16 @@ end
A = CubicSpline(u, t)
@test_throws DataInterpolations.ExtrapolationError A(-2.0)
@test_throws DataInterpolations.ExtrapolationError A(2.0)

@testset "AbstractMatrix" begin
t = 0.1:0.1:1.0
u = [sin.(t) cos.(t)]' |> collect
c = CubicSpline(u, t)
t_test = 0.1:0.05:1.0
u_test = reduce(hcat, c.(t_test))
@test isapprox(u_test[1, :], sin.(t_test), atol = 1e-3)
@test isapprox(u_test[2, :], cos.(t_test), atol = 1e-3)
end
end

@testset "BSplines" begin
Expand Down

0 comments on commit b9637bd

Please sign in to comment.