Skip to content

Commit f89cfba

Browse files
authored
Sub-blockbandwidths for vector (#220)
1 parent 00aebb8 commit f89cfba

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BlockBandedMatrices"
22
uuid = "ffab5731-97b5-5995-9138-79e8c1846df0"
3-
version = "0.13.3"
3+
version = "0.13.4"
44

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

src/interfaceimpl.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ sublayout(::DiagonalLayout{L}, inds::Type{<:NTuple{2,BS}}) where {L,BS<:BlockSli
8181
blockbandwidths(A::BlockedMatrix{<:Any,<:Any,<:NTuple{2,BlockedOneTo{Int,<:AbstractUnitRange{Int}}}}) = bandwidths(A.blocks)
8282
blockbandwidths(A::BlockedMatrix{<:Any,<:Diagonal,<:NTuple{2,BlockedOneTo{Int,<:AbstractUnitRange{Int}}}}) = bandwidths(A.blocks)
8383
subblockbandwidths(A::BlockedMatrix{<:Any,<:Any,<:NTuple{2,BlockedOneTo{Int,<:AbstractUnitRange{Int}}}}) = (0,0)
84+
85+
86+
## BlockVector
87+
subblockbandwidths(a::AbstractBlockVector) = (blocksize(a,1)-1, 0)

test/test_blockbanded.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ import BlockBandedMatrices: MemoryLayout, ColumnMajor, BroadcastStyle,
247247
f(s) = s.block_starts.data
248248
@inferred(f(s))
249249
end
250+
251+
@testset "BlockVector" begin
252+
s = BlockVector(1:21, 1:6)
253+
@test BlockBandedMatrices.subblockbandwidths(s) == (5, 0)
254+
end
250255
end
251256

252257
end # module

0 commit comments

Comments
 (0)