add RG(i::Int) = i*(id) function

This commit is contained in:
kalmar 2017-07-10 19:26:44 +02:00
parent 3b9e405565
commit 8463b928cb
1 changed files with 5 additions and 3 deletions

View File

@ -113,6 +113,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)(T::Type=Int)
isdefined(RG, :basis) || throw("Complete the definition of GroupRing first")
return GroupRingElem(spzeros(T,length(RG.basis)), RG)
@ -187,9 +192,6 @@ end
eltype(X::GroupRingElem) = eltype(X.coeffs)
one(RG::GroupRing) = RG(RG.group())
zero(RG::GroupRing) = RG()
###############################################################################
#
# String I/O