mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2025-01-01 03:40:29 +01:00
get parametrised type constructor finally right
This commit is contained in:
parent
7994c2d308
commit
26abb88b3a
@ -29,6 +29,13 @@ end
|
|||||||
type GroupRingElem{T<:Number} <: RingElem
|
type GroupRingElem{T<:Number} <: RingElem
|
||||||
coeffs::AbstractVector{T}
|
coeffs::AbstractVector{T}
|
||||||
parent::GroupRing
|
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)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
export GroupRing, GroupRingElem
|
export GroupRing, GroupRingElem
|
||||||
@ -52,10 +59,7 @@ parent{T}(g::GroupRingElem{T}) = g.parent
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
function GroupRingElem{T<:Number}(c::AbstractVector{T}, RG::GroupRing)
|
function GroupRingElem{T<:Number}(c::AbstractVector{T}, RG::GroupRing)
|
||||||
isdefined(RG, :basis) || complete(RG)
|
return GroupRingElem{T}(c, 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,RG)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
convert{T<:Number}(::Type{T}, X::GroupRingElem) =
|
convert{T<:Number}(::Type{T}, X::GroupRingElem) =
|
||||||
|
Loading…
Reference in New Issue
Block a user