pretty print of GroupRingElems

This commit is contained in:
kalmar 2017-05-17 12:31:04 +02:00
parent 192c72a39c
commit 82f3ab6c34
1 changed files with 7 additions and 2 deletions

View File

@ -155,8 +155,13 @@ function show(io::IO, A::GroupRing)
end
function show(io::IO, X::GroupRingElem)
T = eltype(X.coeffs)
print(io, "Element of Group Algebra of $(parent(X)) over $T:\n $(X.coeffs)")
if X == parent(X)()
print(io, "0*$((parent(X).group)())")
else
T = eltype(X.coeffs)
elts = ("$(X.coeffs[i])*$(parent(X).basis[i])" for i in 1:length(X) if X.coeffs[i] != zero(T))
join(io, elts, " + ")
end
end
###############################################################################