isdefined(RG, :basis) for safety

This commit is contained in:
kalmar 2017-05-17 12:30:33 +02:00
parent caf72ae980
commit 192c72a39c
1 changed files with 4 additions and 4 deletions

View File

@ -53,11 +53,11 @@ parent{T}(g::GroupRingElem{T}) = g.parent
#
###############################################################################
function GroupRingElem{T<:Number}(c::AbstractVector{T}, A::GroupRing)
length(c) == length(A.basis) || throw("Can't create GroupRingElem -- lengths
differ: length(c) = $(length(c)) != $(length(A.basis)) = length(A.basis)")
function GroupRingElem{T<:Number}(c::AbstractVector{T}, RG::GroupRing)
isdefined(RG, :basis) || complete(RG)
length(c) == length(RG.basis) || throw("Can't create GroupRingElem -- lengths differ: length(c) = $(length(c)) != $(length(RG.basis)) = length(RG.basis)")
GroupRingElem{T}(c,A)
GroupRingElem{T}(c,RG)
end
convert{T<:Number}(::Type{T}, X::GroupRingElem) =