1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-09-20 18:17:59 +02:00

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

This commit is contained in:
kalmar 2017-07-17 09:32:38 +02:00
parent b3024a36c6
commit 1a77e8a2bc

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")