faster (RG::GroupRing)(i::Int)

This commit is contained in:
kalmar 2017-07-17 09:32:38 +02:00
parent b3024a36c6
commit 1a77e8a2bc
1 changed files with 5 additions and 1 deletions

View File

@ -120,7 +120,11 @@ end
zero(RG::GroupRing, T::Type=Int) = RG(T)
one(RG::GroupRing, T::Type=Int) = RG(RG.group(), T)
(RG::GroupRing)(i::Int, T::Type=Int) = i*one(RG, T)
function (RG::GroupRing)(i::Int, T::Type=Int)
elt = RG(T)
elt[RG.group()] = i
return elt
end
function (RG::GroupRing)(T::Type=Int)
isdefined(RG, :basis) || throw("Complete the definition of GroupRing first")