Skip to content

Commit

Permalink
add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentcp committed Apr 11, 2019
1 parent 50364c1 commit f504ea8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ function test_spline_integration()
T = Float64
for N in 0:8
@test squared_spline_integral(N) shifted_spline_integral(N,0)
@test squared_spline_integral(N, Float64) shifted_spline_integral(N,0, Float64)
@test squared_spline_integral(N) shifted_spline_integral(N,0, Float64)
for t in 0:4
f = BSpline(N, T)
@test abs(QuadGK.quadgk(x->f(x)*f(x+t),(-N-2:N+2)..., rtol=sqrt(eps(T)))[1]-shifted_spline_integral(N,t))<10*sqrt(eps(T))
i = QuadGK.quadgk(x->f(x)*f(x+t),(-N-2:N+2)..., rtol=sqrt(eps(T)))[1]
@test abs(i-shifted_spline_integral(N,t))<10*sqrt(eps(T))
@test abs(i-shifted_spline_integral(N,t,Float64))<10*sqrt(eps(T))
@test abs(i-shifted_spline_integral(N,t,BigFloat))<10*sqrt(eps(T))
end
end
end
Expand Down

0 comments on commit f504ea8

Please sign in to comment.