From 51c638fd65453dc1b73ce2b04b432bf7bfbb433c Mon Sep 17 00:00:00 2001 From: kalmar Date: Tue, 11 Jul 2017 16:16:41 +0200 Subject: [PATCH] mul! function for GroupRingElems (different coeffs) --- src/GroupRings.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index 714b330..5d62b8f 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -340,6 +340,15 @@ function mul!{T}(result::GroupRingElem{T}, X::GroupRingElem{T}, Y::GroupRingElem return result end +function mul!(result::GroupRingElem, X::GroupRingElem, Y::GroupRingElem) + S, T, U = eltype(result), eltype(X), eltype(U) + TT = promote_type(S, T, U) + warn("Types $S, $T, $U are not the same, promoting the result to $TT") + result = deepcopy(result) + mul!(convert(Array{TT},result.coeffs), convert(Array{TT}, X.coeffs), convert(Array{TT}, Y.coeffs), parent(X).pm) + return result +end + function mul{T<:Number}(X::AbstractVector{T}, Y::AbstractVector{T}, pm::Array{Int,2}) result = zeros(X)