Cool! Seems to work pretty well even with other packages:
julia> debug_array() do
BlockBandedMatrix{Float64}(undef, 1:3,1:3, (1,1))
end
3×3-blocked 6×6 BlockSkylineMatrix{Float64,Array{Float64,1},BlockBandedMatrices.BlockSkylineSizes{Tuple{BlockArrays.BlockedUnitRange{Array{Int64,1}},BlockArrays.BlockedUnitRange{Array{Int64,1}}},Fill{Int64,1,Tuple{Base.OneTo{Int64}}},Fill{Int64,1,Tuple{Base.OneTo{Int64}}},BandedMatrix{Int64,Array{Int64,2},Base.OneTo{Int64}},Array{Int64,1}}}:
NaN │ NaN NaN │ ⋅ ⋅ ⋅
───────┼────────────┼─────────────────────
NaN │ NaN NaN │ NaN NaN NaN
NaN │ NaN NaN │ NaN NaN NaN
───────┼────────────┼─────────────────────
⋅ │ NaN NaN │ NaN NaN NaN
⋅ │ NaN NaN │ NaN NaN NaN
⋅ │ NaN NaN │ NaN NaN NaN
Note that not every case is caught:
julia> debug_array() do
BandedMatrix{Float64}(undef, (3,3), (1,1))
end
3×3 BandedMatrix{Float64,Array{Float64,2},Base.OneTo{Int64}}:
0.0 0.0 ⋅
0.0 5.0e-324 5.0e-324
⋅ 0.0 0.0
Though that’s due to an arguably bad design in BandedMatrices.jl:
BandedMatrix{T, C}(::UndefInitializer, (n,m)::NTuple{2,Integer}, (a,b)::NTuple{2,Integer}) where {T<:BlasFloat, C<:AbstractMatrix{T}} =
_BandedMatrix(C(undef,max(0,b+a+1),m), n, a, b)