Skip to content

Commit 77f1f97

Browse files
authored
Use axes in making shift operator to support banded-block-banded matr… (#82)
* Use axes in making shift operator to support banded-block-banded matrices * add test * Update test_basisconcat.jl
1 parent 42d1cd0 commit 77f1f97

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
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.6.2"
3+
version = "0.6.3"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/bases/bases.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ function arguments(::ApplyLayout{typeof(*)}, V::SubQuasiArray{<:Any,2,<:Any,<:Tu
344344
A = parent(V)
345345
_,jr = parentindices(V)
346346
first(jr) 1 || throw(BoundsError())
347-
P = _BandedMatrix(Ones{Int}(1,length(jr)), axes(A,2), first(jr)-1,1-first(jr))
347+
P = _BandedMatrix(Ones{Int}((Base.OneTo(1),axes(jr,1))), axes(A,2), first(jr)-1,1-first(jr))
348348
A,P
349349
end
350350

test/test_basisconcat.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using ContinuumArrays, BlockArrays, Test
2-
import ContinuumArrays: PiecewiseBasis, VcatBasis, HvcatBasis
2+
import ContinuumArrays: PiecewiseBasis, VcatBasis, HvcatBasis, arguments, ApplyLayout
33

44
@testset "ConcatBasis" begin
55
@testset "PiecewiseBasis" begin
@@ -39,6 +39,8 @@ import ContinuumArrays: PiecewiseBasis, VcatBasis, HvcatBasis
3939

4040
@test size(S,2) == 5
4141
@test axes(S,1) == axes(S1,1) == axes(S2,1)
42+
@test blockaxes(S) == (Block.(1:1), Block.(1:2))
43+
4244
@test S == S
4345

4446
@test S[0.1,1:5] == [vcat.(S1[0.1,:],0); vcat.(0, S2[0.1,:])]
@@ -71,5 +73,9 @@ import ContinuumArrays: PiecewiseBasis, VcatBasis, HvcatBasis
7173
@test S[0.1,getindex.(Block(1),1:2)] == [[S1[0.1,1] 0; 0 0], [S1[0.1,2] 0; 0 0]]
7274
D = Derivative(axes(S,1))
7375
@test_broken (D*S)[0.1,1] # throws error
76+
77+
v = view(S, :, Block.(2:3))
78+
@test v[0.1,1] == S[0.1,3]
79+
@test blockisequal(axes(arguments(ApplyLayout{typeof(*)}(), v)[2],1), axes(S,2))
7480
end
7581
end

0 commit comments

Comments
 (0)