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 = "BandedMatrices"
uuid = "aae01518-5342-5314-be14-df237901396f"
version = "1.0.1"
version = "1.1.0"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
12 changes: 12 additions & 0 deletions src/banded/BandedMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -956,3 +956,15 @@ function banded_axpy!(a::Number, X::BandedMatrix, Y::BandedMatrix)
end
return Y
end

# show
function show(io::IO, B::BandedMatrix)
print(io, "BandedMatrix(")
l, u = bandwidths(B)
for (ind, b) in enumerate(-l:u)
r = @view B[band(b)]
show(io, b => r)
b == u || print(io, ", ")
end
print(io, ")")
end
3 changes: 3 additions & 0 deletions test/test_miscs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ import BandedMatrices: _BandedMatrix, DefaultBandedMatrix
@test occursin(needle, sprint() do io
show(io, MIME"text/plain"(), BandedMatrix(Eye(3),(1,1)))
end)
B = BandedMatrix(-1=>1:4, 0=>1:5, 1=>1:4)
Bshowstr = sprint(show, B)
@test Bshowstr == "BandedMatrix($(-1=>[1:4;]), $(0=>[1:5;]), $(1=>[1:4;]))"
end
@time @testset "Issue #27" begin
A=brand(1,10,0,9)
Expand Down