diff --git a/Project.toml b/Project.toml index 429ac13..762517a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ClassicalOrthogonalPolynomials" uuid = "b30e2e7b-c4ee-47da-9d5f-2c5c27239acd" authors = ["Sheehan Olver "] -version = "0.14.3" +version = "0.14.4" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" diff --git a/src/normalized.jl b/src/normalized.jl index efc89e8..b4d4419 100644 --- a/src/normalized.jl +++ b/src/normalized.jl @@ -301,4 +301,4 @@ basismap(W::Weighted) = basismap(W.P) const MappedOPLayouts = Union{MappedOPLayout,WeightedOPLayout{MappedOPLayout}} diff_layout(::MappedOPLayouts, A, dims...) = diff_layout(MappedBasisLayout(), A, dims...) -diff_layout(::NormalizedOPLayout, A, dims...) = diff_layout(ApplyLayout{typeof(*)}(), A, dims...) \ No newline at end of file +diff_layout(::AbstractNormalizedOPLayout, A, dims...) = diff_layout(ApplyLayout{typeof(*)}(), A, dims...) \ No newline at end of file diff --git a/test/test_choleskyQR.jl b/test/test_choleskyQR.jl index 905c82a..acd43fc 100644 --- a/test/test_choleskyQR.jl +++ b/test/test_choleskyQR.jl @@ -76,7 +76,7 @@ import LazyArrays: AbstractCachedMatrix, resizedata! # Comparison with Lanczos @test Jchol[1:500,1:500] ≈ Jlanc[1:500,1:500] end - + @testset "w(x) = (1-x)*exp(x)" begin P = Normalized(Legendre()[affine(0..1,Inclusion(-1..1)),:]) x = axes(P,1) @@ -89,7 +89,7 @@ import LazyArrays: AbstractCachedMatrix, resizedata! # Comparison with Lanczos @test Jchol[1:500,1:500] ≈ Jlanc[1:500,1:500] end - + @testset "w(x) = (1-x^2)*exp(x^2)" begin P = Normalized(legendre(0..1)) x = axes(P,1) @@ -102,7 +102,7 @@ import LazyArrays: AbstractCachedMatrix, resizedata! # Comparison with Lanczos @test Jchol[1:500,1:500] ≈ Jlanc[1:500,1:500] end - + @testset "w(x) = x*(1-x^2)*exp(-x^2)" begin P = Normalized(Legendre()[affine(0..1,Inclusion(-1..1)),:]) x = axes(P,1) @@ -227,7 +227,7 @@ import LazyArrays: AbstractCachedMatrix, resizedata! @test Q ≠ P @test Q == Q̃ @test Q̃ == Q - + @test Q[0.1,1] ≈ _p0(Q) ≈ 1/sqrt(2) @test Q[0.1,1:10] ≈ Q̃[0.1,1:10] @test Q[0.1,10_000] ≈ Q̃[0.1,10_000] @@ -247,11 +247,20 @@ import LazyArrays: AbstractCachedMatrix, resizedata! U = ChebyshevU() Q = orthogonalpolynomial(x -> (1+x^2)*sqrt(1-x^2), U) x = axes(U,1) - + @test Q[0.1,1] ≈ _p0(Q) ≈ 1/sqrt(sum(expand(Weighted(U),x -> (1+x^2)*sqrt(1-x^2)))) @test bandwidths(Q\U) == (0,2) Q̃ = OrthogonalPolynomial(x -> (1+x^2)*sqrt(1-x^2), U) @test jacobimatrix(Q)[1:10,1:10] == jacobimatrix(Q̃)[1:10,1:10] end + + @testset "diff" begin + P = Legendre() + x = axes(P,1) + Q = OrthogonalPolynomial(1 .- x) + Q̃ = Normalized(Jacobi(1,0)) + @test_skip diff(Q)[0.1,1:5] ≈ diff(Q̃)[0.1,1:5] # broken due to lazy array issues + @test [diff(Q)[0.1,k] for k=1:5] ≈ diff(Q̃)[0.1,1:5] + end end \ No newline at end of file