From b73aebe33a34bb77992e58df9cc6b0ed6c71779a Mon Sep 17 00:00:00 2001 From: kalmar Date: Wed, 17 May 2017 12:34:24 +0200 Subject: [PATCH] star-involution using setindex! --- src/GroupRings.jl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index 261cc83..8dc3ec3 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -277,6 +277,25 @@ end (*)(X::GroupRingElem, Y::GroupRingElem) = groupring_mult(X,Y) +############################################################################### +# +# *-involution +# +############################################################################### + +function star(X::GroupRingElem) + isdefined(X, :parent) || throw("Define parent object for $X first") + RG = parent(X) + result = RG() + for (i,c) in enumerate(X.coeffs) + if c != zero(eltype(X.coeffs)) + g = inv(RG.basis[i]) + result[g] = c + end + end + return result +end + ############################################################################### # # Misc