Open longemen3000 opened 1 year ago
this could be solved by:
defining Base.isstored(A::Diagonal,i::Int,j::Int) == i == j ? isstored(A.diag,i) : false
Replacing the code in arrayshow.jl: https://github.com/JuliaLang/julia/blob/36e188f9dcd99555af74dadcfcfdda6a41e348b4/base/arrayshow.jl#L67-L72
to:
if isstored(X,i,j) && isassigned(X,i,j)
aij = alignment(io, X[i,j])::Tuple{Int,Int}
else
aij = undef_ref_alignment
end
I am not certain about the proposed fix there, since the code expects getindex to work, and then calls Base.replace_in_print_matrix
to call Base.replace_with_centered_mark
on the resulting element repr
.
The issue is not fixed with JuliaLang/julia#50391, but defines the necessary functions to work on a fix
Right, github got confused by the text there, but my uncertainty remains over the proposed answer here
Yeah, I will need to see what to do about that, but at least there is now a way to detect if an element of a matrix is stored or not
Yeah, that seemed to be the goal of a5e032e29686fabc8b88a10726c79feb18900055 (#33821), which originally started to add that.
Some matrices (
SparseMatrixCSC
andDiagonal
, as far as i know) depend on a type definingiszero(x::T)
andzero(Type{T})
to work. a MWE:version info.
related:
https://github.com/korsbo/Latexify.jl/issues/269