deepcopy result if result === X to prevent X from zeroing

This commit is contained in:
kalmar 2017-07-11 16:02:43 +02:00
parent 5a3e2761a4
commit b80db52742
1 changed files with 5 additions and 2 deletions

View File

@ -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