new version of *, with optional check::Bool=true

This commit is contained in:
kalmar 2017-07-19 22:43:46 +02:00
parent f586cb5146
commit f2ad7c8045
1 changed files with 9 additions and 4 deletions

View File

@ -371,10 +371,15 @@ function mul!{T<:Number}(result::GroupRingElem{T}, X::GroupRingElem, Y::GroupRin
return result
end
function mul{T<:Number}(X::AbstractVector{T}, Y::AbstractVector{T},
pm::Array{Int,2})
result = zeros(X)
mul!(result, X, Y, pm)
function *{T<:Number, S<:Number}(X::GroupRingElem{T}, Y::GroupRingElem{S}, check::Bool=true)
if true
parent(X) == parent(Y) || throw("Elements don't seem to belong to the same Group Ring!")
end
TT = typeof(first(X.coeffs)*first(Y.coeffs))
warn("Multiplying elements with different base rings! Promoting the result to $TT.")
result = mul!(result, X, Y)
return result
end