add (RG::GroupRing)(::Vector, ::Type; alt=false)

this was previously defined in GroupRings
This commit is contained in:
kalmarek 2018-07-31 09:49:55 +02:00
parent 16dc0c7591
commit 1ca77f1f19
1 changed files with 9 additions and 0 deletions

View File

@ -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)]