1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-07-12 01:35:29 +02:00

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

View File

@ -80,6 +80,15 @@ function central_projection(RG::GroupRing, chi::AbstractCharacter, T::Type=Ratio
return result return result
end 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 function idempotents(RG::GroupRing{Generic.PermGroup{S}}, T::Type=Rational{Int}) where S<:Integer
if RG.group.n == 1 if RG.group.n == 1
return GroupRingElem{T}[one(RG,T)] return GroupRingElem{T}[one(RG,T)]