1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-12-28 18:50:29 +01:00

mul! function for GroupRingElems (different coeffs)

This commit is contained in:
kalmar 2017-07-11 16:16:41 +02:00
parent b80db52742
commit 51c638fd65

View File

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