mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2025-01-01 03:40:29 +01:00
check on the vector length in GroupRingElem constructor
This commit is contained in:
parent
ec39853e92
commit
3da2110355
@ -53,7 +53,12 @@ parent{T}(g::GroupRingElem{T}) = g.parent
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
GroupRingElem{T}(c::AbstractVector{T}, A::GroupRing) = GroupRingElem{T}(c,A)
|
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)")
|
||||||
|
|
||||||
|
GroupRingElem{T}(c,A)
|
||||||
|
end
|
||||||
|
|
||||||
convert{T<:Number}(::Type{T}, X::GroupRingElem) =
|
convert{T<:Number}(::Type{T}, X::GroupRingElem) =
|
||||||
GroupRingElem(parent(X), convert(AbstractVector{T}, X.coeffs))
|
GroupRingElem(parent(X), convert(AbstractVector{T}, X.coeffs))
|
||||||
|
Loading…
Reference in New Issue
Block a user