1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-11-11 12:35:27 +01:00

better show of ::GroupRingElem

This commit is contained in:
kalmar 2017-05-19 10:32:09 +02:00
parent 6379c76646
commit 1e990f5896

View File

@ -179,8 +179,9 @@ function show(io::IO, X::GroupRingElem)
if X == RG(T) if X == RG(T)
print(io, "$(zero(T))*$((RG.group)())") print(io, "$(zero(T))*$((RG.group)())")
else else
elts = ("$(X[i])*$(RG.basis[i])" for i in 1:length(RG.basis) if X[i] != zero(T)) non_zeros = ((X.coeffs[i], RG.basis[i]) for i in findn(X.coeffs))
join(io, elts, " + ") elts = ("$(sign(c)> 0? " + ": " - ")$(abs(c))*$g" for (c,g) in non_zeros)
join(io, elts, "")
end end
end end