1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-12-29 11:00:28 +01:00

hide correctness check of GroupRingElem behind check arg

This commit is contained in:
kalmar 2017-05-17 17:39:56 +02:00
parent 796f04261d
commit 203743bb4d

View File

@ -34,11 +34,12 @@ type GroupRingElem{T<:Number} <: RingElem
coeffs::AbstractVector{T}
parent::GroupRing
function GroupRingElem(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)")
return new(c,RG)
function GroupRingElem(c::AbstractVector{T}, RG::GroupRing, check=true)
if check
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)")
end
return new(c, RG)
end
end