From 933c578b8fa64543870ed8e2cc229d65cd693c2e Mon Sep 17 00:00:00 2001 From: kalmar Date: Wed, 17 May 2017 11:34:39 +0200 Subject: [PATCH] (::GroupRing)() zero elt --- src/GroupRings.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index 0db8715..9c39e78 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -83,6 +83,11 @@ end # ############################################################################### +function (RG::GroupRing)(T::Type=Int) + isdefined(RG, :basis) || throw("Complete the definition of GroupRing first") + return GroupRingElem(spzeros(T,length(RG.basis)), RG) +end + function (A::GroupRing)(X::GroupRingElem) length(X) == length(A.basis) || throw("Can not coerce to $A: lengths differ") X.parent = A