mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-07-30 14:10:31 +02:00
groupring_mult should preserve type, when possible
This commit is contained in:
parent
2c43984e19
commit
04ee0ac659
@ -229,8 +229,18 @@ function groupring_mult!(X,Y,pm,result)
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
function group_star_multiplication{T<:Number}(X::GroupRingElem{T},
|
function groupring_mult{T<:Number}(X::AbstractVector{T}, Y::AbstractVector{T},
|
||||||
Y::GroupRingElem{T})
|
pm::Array{Int,2})
|
||||||
|
result = zeros(X)
|
||||||
|
return groupring_mult!(X,Y,pm,result)
|
||||||
|
end
|
||||||
|
|
||||||
|
function groupring_mult(X::AbstractVector, Y::AbstractVector, pm::Array{Int,2})
|
||||||
|
T = promote_type(eltype(X), eltype(Y))
|
||||||
|
result = zeros(T, X)
|
||||||
|
return groupring_mult!(X,Y,pm,result)
|
||||||
|
end
|
||||||
|
|
||||||
parent(X) == parent(Y) || throw(ArgumentError(
|
parent(X) == parent(Y) || throw(ArgumentError(
|
||||||
"Elements don't seem to belong to the same Group Algebra!"))
|
"Elements don't seem to belong to the same Group Algebra!"))
|
||||||
result = algebra_multiplication(X.coeffs, Y.coeffs, X.pm)
|
result = algebra_multiplication(X.coeffs, Y.coeffs, X.pm)
|
||||||
|
Loading…
Reference in New Issue
Block a user