Skip to content

Commit ec53e33

Browse files
committed
Add show functions
1 parent 7b9f8d2 commit ec53e33

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/system/entry.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ mutable struct Entry{ET}
1010
Entry(dims...; static = true) = Entry{Float64}(dims...; static = static)
1111
end
1212

13+
function Base.show(io::IO, mime::MIME{Symbol("text/plain")}, entry::Entry)
14+
println(io, "Entry with value:")
15+
show(io, mime, entry.value)
16+
end
17+
18+
1319
function Base.zero(::Entry{ET}) where ET
1420
dims = [ET.parameters[1].parameters...]
1521
return Entry{ET.parameters[2]}(dims...)

src/system/system.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ struct System{N}
8080
System(A, dims; force_static = false) = System{Float64}(A, dims; force_static = force_static)
8181
end
8282

83+
function Base.show(io::IO, mime::MIME{Symbol("text/plain")}, system::System{N}) where {N}
84+
println(io, "System with "*string(N)*" nodes.")
85+
SparseArrays._show_with_braille_patterns(io, system.matrix_entries)
86+
end
87+
8388

8489
@inline children(system, v) = outneighbors(system.dfs_graph, v)
8590
@inline connections(system, v) = neighbors(system.graph, v)

0 commit comments

Comments
 (0)