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
3 changes: 2 additions & 1 deletion src/BlockSkylineMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ checkbandwidths(N, M, l::AbstractVector{Int}, u::AbstractVector{Int}) =
function bb_blockstarts(ax, l::AbstractVector{Int}, u::AbstractVector{Int})
N,M = blocksize.(ax,1)
L,U = maximum(l), maximum(u)
b_start = BandedMatrix{Int}(undef, (N, M), (L, U))
# zero-filled so in-band slots for blocks outside a column's own band read as 0
b_start = BandedMatrix(Zeros{Int}(N, M), (L, U))
-L > U && return b_start

checkbandwidths(N, M, l, u)
Expand Down
8 changes: 8 additions & 0 deletions test/test_blockskyline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ Random.seed!(0)
s = split(sprint(show, "text/plain", B), '\n')[2]
@test s == " 1 │ 0 0 │ ⋅ ⋅ ⋅ │ ⋅ ⋅ ⋅ ⋅"
end

@testset "block_starts" begin
# block (3,2) is in the band of block_starts but not stored, so must be 0
bs = BlockBandedMatrices.BlockSkylineSizes([2,3,4], [1,2,3], [2,0,0], [0,1,1])
@test Matrix(bs.block_starts) == [1 10 0;
3 12 20;
6 0 23]
end
end

end # module
Loading