Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "BlockBandedMatrices"
uuid = "ffab5731-97b5-5995-9138-79e8c1846df0"
version = "0.13.4"
version = "0.13.5"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
7 changes: 7 additions & 0 deletions src/interfaceimpl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ function blockbandwidths(::AbstractBandedLayout, (a,b)::Tuple{AbstractBlockedUni
end
end

function blockbandwidths(::AbstractBandedLayout, (a,b)::Tuple{BlockedOneTo{<:Any,<:AbstractRange}, BlockedOneTo{<:Any,<:AbstractRange}}, A)
a ≠ b && return blockbandwidths(UnknownLayout(), (a,b), A) # can implement same step but not done yet
l,u = bandwidths(A)
s = step(a.lasts) # normal blocksize
(l+s-1) ÷ s, (u+s-1) ÷ s
end




Expand Down
4 changes: 4 additions & 0 deletions test/test_misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ Base.size(F::FiniteDifference) = (F.n,F.n)
@test blockrowsupport(B,Block(1)) == Block.(1:2)
@test blockrowsupport(B,Block(4)) == Block.(3:5)


Q = Eye((a,))[:,Block(2)]
@test Q isa BandedMatrix
@test blockcolsupport(Q,Block(1)) == Block.(2:2)
Expand All @@ -210,6 +211,9 @@ Base.size(F::FiniteDifference) = (F.n,F.n)

B = _BandedMatrix(randn(5,length(a)), a, 3, 1)
@test blockbandwidths(B) == (4,0)

B = _BandedMatrix(BlockedArray(randn(5,length(a)),(Base.OneTo(5),a)), a, 3, 1)
@test blockbandwidths(B) == (2,1)
end
end

Expand Down
Loading