mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2025-01-01 11:45:28 +01:00
result is the firs argument of mul!
This commit is contained in:
parent
dd518574ff
commit
688dfa5062
@ -311,8 +311,7 @@ end
|
|||||||
(+)(X::GroupRingElem, Y::GroupRingElem) = add(X,Y)
|
(+)(X::GroupRingElem, Y::GroupRingElem) = add(X,Y)
|
||||||
(-)(X::GroupRingElem, Y::GroupRingElem) = add(X,-Y)
|
(-)(X::GroupRingElem, Y::GroupRingElem) = add(X,-Y)
|
||||||
|
|
||||||
function mul!{T}(X::AbstractVector{T}, Y::AbstractVector{T},
|
function mul!{T}(result::AbstractVector{T}, X::AbstractVector{T}, Y::AbstractVector{T}, pm::Array{Int,2})
|
||||||
pm::Array{Int,2}, result::AbstractVector{T})
|
|
||||||
z = zero(T)
|
z = zero(T)
|
||||||
for (j,y) in enumerate(Y)
|
for (j,y) in enumerate(Y)
|
||||||
if y != z
|
if y != z
|
||||||
@ -328,21 +327,21 @@ end
|
|||||||
|
|
||||||
function mul!(result::GroupRingElem, X::GroupRingElem, Y::GroupRingElem)
|
function mul!(result::GroupRingElem, X::GroupRingElem, Y::GroupRingElem)
|
||||||
result.coeffs *= 0
|
result.coeffs *= 0
|
||||||
mul!(X.coeffs, Y.coeffs, parent(X).pm, result.coeffs)
|
mul!(result.coeffs, X.coeffs, Y.coeffs, parent(X).pm)
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
function mul{T<:Number}(X::AbstractVector{T}, Y::AbstractVector{T},
|
function mul{T<:Number}(X::AbstractVector{T}, Y::AbstractVector{T},
|
||||||
pm::Array{Int,2})
|
pm::Array{Int,2})
|
||||||
result = zeros(X)
|
result = zeros(X)
|
||||||
mul!(X,Y,pm,result)
|
mul!(result, X, Y, pm)
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
function mul(X::AbstractVector, Y::AbstractVector, pm::Array{Int,2})
|
function mul(X::AbstractVector, Y::AbstractVector, pm::Array{Int,2})
|
||||||
T = promote_type(eltype(X), eltype(Y))
|
T = promote_type(eltype(X), eltype(Y))
|
||||||
result = zeros(T, X)
|
result = zeros(T, X)
|
||||||
mul!(Vector{T}(X), Vector{T}(Y), pm, result)
|
mul!(result, Vector{T}(X), Vector{T}(Y), pm)
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user