From 82f3ab6c34c1e8adde43e769a7068ef886b216b6 Mon Sep 17 00:00:00 2001 From: kalmar Date: Wed, 17 May 2017 12:31:04 +0200 Subject: [PATCH] pretty print of GroupRingElems --- src/GroupRings.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index 112260f..5a6ee2f 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -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 ###############################################################################