Skip to content

Commit

Permalink
fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Oct 25, 2018
1 parent 9245fb3 commit 07ab5cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/jacobi_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions test/legendre_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ 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
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
Expand All @@ -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

0 comments on commit 07ab5cc

Please sign in to comment.