You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
summary(io::IO, a::AbstractArray{<:RingElem}) =oscar_array_summary(io, a, axes(a))
functionoscar_array_summary(io::IO, a, inds::Tuple{Vararg{OneTo}})
print(io, Base.dims2string(length.(inds)), "")
showarg(io, a, true)
end
function Base.showarg(io::IO, x::Vector{<:RingElem}, toplevel::Bool)
if toplevel
print(io, "Vector of ring elements")
returnend# original code follows
toplevel ||print(io, "::")
print(io, typeof(x))
end
After:
julia> v
2-element Vector of ring elements:
x^2 - 3*y
1//4*x^2 - 1//2*sqrt(3)*x*y + 3//2*sqrt(3)*x + 3//4*y^2 + 3//2*y
Of course one could do something similar for FieldElem, ModuleElem, etc.
and the output could be refined, e.g. it could print the parent (though I'd
not do this for now, as it raises many questions: handle empty vectors; should
it check that all entries have the same parent; and if not, what then? etc.)
Questions:
Is this type piracy? Vector is not our type, but RingElem is...
Would this be useful for improving our printing situation?
Where else is using showarg? If the above is too broad, we could also
instead override summary(io::IO, x::Vector{<:RingElem}).
The text was updated successfully, but these errors were encountered:
Before:
Apply this hack (?):
After:
Of course one could do something similar for
FieldElem
,ModuleElem
, etc.and the output could be refined, e.g. it could print the parent (though I'd
not do this for now, as it raises many questions: handle empty vectors; should
it check that all entries have the same parent; and if not, what then? etc.)
Questions:
RingElem
is...showarg
? If the above is too broad, we could alsoinstead override
summary(io::IO, x::Vector{<:RingElem})
.The text was updated successfully, but these errors were encountered: