From b80db5274270dba4b6f92666528fee497c4f76bb Mon Sep 17 00:00:00 2001 From: kalmar Date: Tue, 11 Jul 2017 16:02:43 +0200 Subject: [PATCH] deepcopy result if result === X to prevent X from zeroing --- src/GroupRings.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index 4d23d13..714b330 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -331,8 +331,11 @@ function mul!{T}(result::AbstractVector{T}, X::AbstractVector{T}, Y::AbstractVec end end -function mul!(result::GroupRingElem, X::GroupRingElem, Y::GroupRingElem) - result.coeffs *= 0 +function mul!{T}(result::GroupRingElem{T}, X::GroupRingElem{T}, Y::GroupRingElem{T}) + # @show result === X + if result === X + result = deepcopy(result) + end mul!(result.coeffs, X.coeffs, Y.coeffs, parent(X).pm) return result end