mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-11-19 14:35:27 +01:00
simple constructor from support of GroupRingElem
This commit is contained in:
parent
29f5bc1ee7
commit
4dd2c02a4c
@ -153,12 +153,9 @@ function (RG::GroupRing){T<:Number}(x::AbstractVector{T})
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
function (RG::GroupRing{Gr,T}){Gr<:Group, T<:GroupElem}(V::Vector{T},
|
function (RG::GroupRing{Gr,T}){Gr<:Group, T<:GroupElem}(V::Vector{T}, S::Type=Int)
|
||||||
S::Type=Rational{Int}; alt=false)
|
|
||||||
res = RG(S)
|
res = RG(S)
|
||||||
for g in V
|
for g in V
|
||||||
c = (alt ? sign(g)*one(S) : one(S))
|
|
||||||
res[g] += c/length(V)
|
|
||||||
end
|
end
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user