From 051d1d925103cac5e8b83d2a902cc716d61322ae Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Thu, 25 Oct 2018 19:51:32 +0200 Subject: [PATCH] fix #2 --- test/jacobi_test.jl | 4 ++-- test/legendre_test.jl | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/jacobi_test.jl b/test/jacobi_test.jl index 96ea7e1..4789ff0 100644 --- a/test/jacobi_test.jl +++ b/test/jacobi_test.jl @@ -25,8 +25,8 @@ for p in 0:10, α in range(-0.9, stop=4, length=50), β in range(-0.9, stop=4, l x1, w1 = gaussjacobi(p+1, α, β) @inferred PolynomialBases.gauss_jacobi_nodes_and_weights(p, α, β) x2, w2 = PolynomialBases.gauss_jacobi_nodes_and_weights(p, α, β) - @test norm(x1 - x2) < 1.e-11 - @test norm(w1 - w2) < 1.e-11 + @test x1 ≈ x2 atol=1.e-11 + @test w1 ≈ w2 atol=1.e-11 end # Vandermonde matrices for Gauss Jacobi nodes and weights diff --git a/test/legendre_test.jl b/test/legendre_test.jl index be41798..0a68414 100644 --- a/test/legendre_test.jl +++ b/test/legendre_test.jl @@ -19,8 +19,8 @@ for p in 0:20 x1, w1 = gausslegendre(p+1) @inferred PolynomialBases.gauss_legendre_nodes_and_weights(p) x2, w2 = PolynomialBases.gauss_legendre_nodes_and_weights(p) - @test norm(x1 - x2) < 1.e-14 - @test norm(w1 - w2) < 1.e-14 + @test x1 ≈ x2 atol=1.e-14 + @test w1 ≈ w2 atol=1.e-14 end # Lobatto Legendre nodes and weights @@ -28,8 +28,8 @@ for p in 1:20 x1, w1 = gausslobatto(p+1) @inferred PolynomialBases.lobatto_legendre_nodes_and_weights(p) x2, w2 = PolynomialBases.lobatto_legendre_nodes_and_weights(p) - @test norm(x1 - x2) < 1.e-14 - @test norm(w1 - w2) < 1.e-14 + @test x1 ≈ x2 atol=1.e-14 + @test w1 ≈ w2 atol=1.e-14 end # Derivative and mass matrices for Gauss Legendre nodes and weights @@ -40,8 +40,8 @@ for p in 0:8 V = legendre_vandermonde(basis) Dhat = legendre_D(p) - @test norm(basis.D - V * Dhat / V) < 1.e-13 + @test basis.D ≈ V*Dhat/V atol=1.e-13 Mhat = legendre_M(p) - @test norm(Diagonal(basis.weights) - V' \ Mhat / V) < 1.e-13 + @test Diagonal(basis.weights) ≈ V'\Mhat/V atol=1.e-13 end