diff --git a/Project.toml b/Project.toml index f437e67..4fb43f5 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ClassicalOrthogonalPolynomials" uuid = "b30e2e7b-c4ee-47da-9d5f-2c5c27239acd" authors = ["Sheehan Olver "] -version = "0.15.4" +version = "0.15.5" [deps] @@ -49,7 +49,7 @@ HypergeometricFunctions = "0.3.4" InfiniteArrays = " 0.15" InfiniteLinearAlgebra = "0.10.1" IntervalSets = "0.7" -LazyArrays = "2.7" +LazyArrays = "2.8" LazyBandedMatrices = "0.11" MutableArithmetics = "1" QuasiArrays = "0.12" diff --git a/src/normalized.jl b/src/normalized.jl index fe01dc5..f642753 100644 --- a/src/normalized.jl +++ b/src/normalized.jl @@ -303,3 +303,9 @@ diff_layout(::MappedOPLayouts, A, order::Int; dims...) = diff_layout(MappedBasis diff_layout(::MappedOPLayouts, A, order...; dims...) = diff_layout(MappedBasisLayout(), A, order...; dims...) diff_layout(::AbstractNormalizedOPLayout, A, order...; dims...) = diff_layout(ApplyLayout{typeof(*)}(), A, order...; dims...) + +function qr(A::AbstractQuasiMatrix) + P = normalized(basis(A)) + Q,R = qr(P \ A) + P * Q[:, axes(A,2)], R # TODO: ContinuumFactorization +end \ No newline at end of file diff --git a/test/test_roots.jl b/test/test_roots.jl index 58c9a5a..c5dc663 100644 --- a/test/test_roots.jl +++ b/test/test_roots.jl @@ -1,4 +1,4 @@ -using ClassicalOrthogonalPolynomials, Random, Test +using ClassicalOrthogonalPolynomials, QuasiArrays, Random, Test using ClassicalOrthogonalPolynomials: sample Random.seed!(5) @@ -24,6 +24,13 @@ end @test (Legendre() \ A)[1:5,1] ≈ [1; zeros(4)] # test transform bug @test (P \ A)[1:5,1] ≈ [sqrt(2); zeros(4)] Q,R = qr(P \ A) + @test (P * (Q*R))[0.1,:] ≈ A[0.1,:] + @test (A*inv(R))[0.1,:] ≈ QuasiArrays.ApplyQuasiArray(*, P, Q)[0.1,1:6] + + Q,R = qr(A) + @test Q[0.1,:]'R ≈ A[0.1,:]' + + # sum(expand(Q[:,k] .^2) for k=axes(Q,2)) end @testset "minimum/maximum/extrema (#242)" begin