From 1ca77f1f19152be1dd991b3de24f75fc2392cd78 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Tue, 31 Jul 2018 09:49:55 +0200 Subject: [PATCH] add (RG::GroupRing)(::Vector, ::Type; alt=false) this was previously defined in GroupRings --- src/Projections.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Projections.jl b/src/Projections.jl index e64aced..98e8330 100644 --- a/src/Projections.jl +++ b/src/Projections.jl @@ -80,6 +80,15 @@ function central_projection(RG::GroupRing, chi::AbstractCharacter, T::Type=Ratio return result end +function (RG::GroupRing{Gr,T})(V::Vector{T}, S::Type=Rational{Int}; alt=false) where {Gr<:Generic.PermGroup, T<:GroupElem} + res = RG(S) + for g in V + c = (alt ? sign(g)*one(S) : one(S)) + res[g] += c/length(V) + end + return res +end + function idempotents(RG::GroupRing{Generic.PermGroup{S}}, T::Type=Rational{Int}) where S<:Integer if RG.group.n == 1 return GroupRingElem{T}[one(RG,T)]