mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-10-11 15:00:36 +02:00
make another version of mul! for GroupRingElts
This commit is contained in:
parent
4c275460cc
commit
5c2fabfb08
@ -335,12 +335,23 @@ function mul!{T}(result::AbstractVector{T},
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mul!{T}(result::GroupRingElem{T}, X::GroupRingElem{T}, Y::GroupRingElem{T})
|
function mul!{T}(result::GroupRingElem{T}, X::GroupRingElem, Y::GroupRingElem)
|
||||||
# @show result === X
|
|
||||||
if result === X
|
if result === X
|
||||||
result = deepcopy(result)
|
result = deepcopy(result)
|
||||||
end
|
end
|
||||||
mul!(result.coeffs, X.coeffs, Y.coeffs, parent(X).pm)
|
|
||||||
|
z = zero(T)
|
||||||
|
result.coeffs .= z
|
||||||
|
|
||||||
|
for j in eachindex(Y.coeffs)
|
||||||
|
if Y.coeffs[j] != z
|
||||||
|
for i in eachindex(X.coeffs)
|
||||||
|
if X.coeffs[i] != z
|
||||||
|
result.coeffs[parent(X).pm[i,j]] += X[i]*Y[j]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user