Skip to content

Commit 13b6d27

Browse files
authored
Pass dimension for projection factorizations (#139)
1 parent e1eadf8 commit 13b6d27

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ContinuumArrays"
22
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
3-
version = "0.12.1"
3+
version = "0.12.2"
44

55

66
[deps]

src/bases/bases.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ _sub_factorize(::Tuple{Any,Any}, (kr,jr)::Tuple{Any,OneTo}, L, dims...; kws...)
297297

298298
# If jr is not OneTo we project
299299
_sub_factorize(::Tuple{Any,Any}, (kr,jr), L, dims...; kws...) =
300-
ProjectionFactorization(factorize(parent(L)[:,OneTo(maximum(jr))]), jr)
300+
ProjectionFactorization(factorize(parent(L)[:,OneTo(maximum(jr))], dims...), jr)
301301

302302
_factorize(::SubBasisLayout, L, dims...; kws...) = _sub_factorize(size(parent(L)), parentindices(L), L, dims...; kws...)
303303

test/test_splines.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,13 @@ import ContinuumArrays: basis, AdjointBasisLayout, ExpansionLayout, BasisLayout,
304304
@test factorize(L[:,2:end-1]) isa ContinuumArrays.ProjectionFactorization
305305
@test factorize(L[:,Base.OneTo(2)]) isa ContinuumArrays.ProjectionFactorization
306306
@test L[:,1:2] \ x == L[:,Base.OneTo(2)] \ x == [1,2]
307-
@test L \ [x one(x)] [L\x L\one(x)]
308-
@test factorize(L) \ QuasiOnes(x, Base.OneTo(3)) L \ QuasiOnes(x, Base.OneTo(3)) ones(3,3)
309-
@test size(factorize(L), 2) == size(L, 2)
307+
308+
@testset "multiple" begin
309+
@test L \ [x one(x)] [L\x L\one(x)]
310+
@test factorize(L) \ QuasiOnes(x, Base.OneTo(3)) L \ QuasiOnes(x, Base.OneTo(3)) ones(3,3)
311+
@test size(factorize(L), 2) == size(L, 2)
312+
@test L \ [x exp.(x)] == L[:,1:size(L,2)] \ [x exp.(x)] == [L\x L\exp.(x)]
313+
end
310314

311315
L = LinearSpline(range(0,1; length=10_000))
312316
x = axes(L,1)

0 commit comments

Comments
 (0)