From 03de314479bd3b0673fe153a87bcb09606b9dfae Mon Sep 17 00:00:00 2001 From: kalmar Date: Tue, 16 May 2017 18:31:26 +0200 Subject: [PATCH] basic constructors of GroupRingElem --- src/GroupAlgebras.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GroupAlgebras.jl b/src/GroupAlgebras.jl index 90d1d58..108a589 100644 --- a/src/GroupAlgebras.jl +++ b/src/GroupAlgebras.jl @@ -27,16 +27,16 @@ type GroupRingElem{T<:Number} end end -# GroupAlgebraElement(c,pm,b) = GroupAlgebraElement(c,pm) -GroupAlgebraElement{T}(c::AbstractVector{T},pm) = GroupAlgebraElement{T}(c,pm) -convert{T<:Number}(::Type{T}, X::GroupAlgebraElement) = - GroupAlgebraElement(convert(AbstractVector{T}, X.coefficients), X.product_matrix) show{T}(io::IO, X::GroupAlgebraElement{T}) = print(io, "Element of Group Algebra over $T of length $(length(X)):\n $(X.coefficients)") +GroupRingElem{T}(c::AbstractVector{T}, A::GroupRing) = GroupRingElem{T}(c,A) + +convert{T<:Number}(::Type{T}, X::GroupRingElem) = + GroupRingElem(parent(X), convert(AbstractVector{T}, X.coeffs)) end (==)(X::GroupAlgebraElement, Y::GroupAlgebraElement) = isequal(X,Y)