Skip to content

Commit

Permalink
tests of full
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Dec 17, 2017
1 parent d3c922a commit 64de81b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/periodic_operators_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,21 @@ end

for T in (Float32, Float64), accuracy_order in 1:10, derivative_order in 1:3
xmin = zero(T)
xmax = one(T)
xmax = 5*one(T)
N = 51
x = linspace(xmin, xmax, N)
u = x.^5
dest_serial = zeros(u)
dest_threads= zeros(u)
dest_full = zeros(u)
D_serial = periodic_derivative_operator(derivative_order, accuracy_order, xmin, xmax, N)
D_threads= periodic_derivative_operator(derivative_order, accuracy_order, xmin, xmax, N, Val{:threads}())
D_full = full(D_serial)
A_mul_B!(dest_serial, D_serial, u)
A_mul_B!(dest_threads, D_threads, u)
A_mul_B!(dest_full, D_full, u)
for i in eachindex(u)
@test dest_serial[i] dest_threads[i]
@test isapprox(dest_serial[i], dest_full[i], rtol=5*sqrt(eps(T)))
end
end

0 comments on commit 64de81b

Please sign in to comment.