From 62968b9409e32acfaf08be418980f25754e47fb0 Mon Sep 17 00:00:00 2001 From: Daniel VandenHeuvel <95613936+DanielVandH@users.noreply.github.com> Date: Thu, 30 Jan 2025 15:03:41 +0000 Subject: [PATCH] Sub-blockbandwidths for vector --- Project.toml | 2 +- src/interfaceimpl.jl | 4 ++++ test/test_blockbanded.jl | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d39b7d9..fbc68ec 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "BlockBandedMatrices" uuid = "ffab5731-97b5-5995-9138-79e8c1846df0" -version = "0.13.3" +version = "0.13.4" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" diff --git a/src/interfaceimpl.jl b/src/interfaceimpl.jl index 1b59d7e..1b50475 100644 --- a/src/interfaceimpl.jl +++ b/src/interfaceimpl.jl @@ -81,3 +81,7 @@ sublayout(::DiagonalLayout{L}, inds::Type{<:NTuple{2,BS}}) where {L,BS<:BlockSli blockbandwidths(A::BlockedMatrix{<:Any,<:Any,<:NTuple{2,BlockedOneTo{Int,<:AbstractUnitRange{Int}}}}) = bandwidths(A.blocks) blockbandwidths(A::BlockedMatrix{<:Any,<:Diagonal,<:NTuple{2,BlockedOneTo{Int,<:AbstractUnitRange{Int}}}}) = bandwidths(A.blocks) subblockbandwidths(A::BlockedMatrix{<:Any,<:Any,<:NTuple{2,BlockedOneTo{Int,<:AbstractUnitRange{Int}}}}) = (0,0) + + +## BlockVector +subblockbandwidths(a::AbstractBlockVector) = (blocksize(a,1)-1, 0) \ No newline at end of file diff --git a/test/test_blockbanded.jl b/test/test_blockbanded.jl index ca8b2a9..35de623 100644 --- a/test/test_blockbanded.jl +++ b/test/test_blockbanded.jl @@ -247,6 +247,11 @@ import BlockBandedMatrices: MemoryLayout, ColumnMajor, BroadcastStyle, f(s) = s.block_starts.data @inferred(f(s)) end + + @testset "BlockVector" begin + s = BlockVector(1:21, 1:6) + @test BlockBandedMatrices.subblockbandwidths(s) == (5, 0) + end end end # module