mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2025-01-01 03:40:29 +01:00
multiplication in the GroupRing
This commit is contained in:
parent
7204492e53
commit
ba51f2ba0e
@ -144,23 +144,21 @@ function algebra_multiplication{T<:Number}(X::AbstractVector{T}, Y::AbstractVect
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
function group_star_multiplication{T<:Number}(X::GroupAlgebraElement{T},
|
function group_star_multiplication{T<:Number}(X::GroupRingElem{T},
|
||||||
Y::GroupAlgebraElement{T})
|
Y::GroupRingElem{T})
|
||||||
X.product_matrix == Y.product_matrix || 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.coefficients, Y.coefficients, X.product_matrix)
|
result = algebra_multiplication(X.coeffs, Y.coeffs, X.pm)
|
||||||
return GroupAlgebraElement(result, X.product_matrix)
|
return GroupRingElem(result, parent(X))
|
||||||
end
|
end
|
||||||
|
|
||||||
function group_star_multiplication{T<:Number, S<:Number}(
|
function group_star_multiplication{T<:Number, S<:Number}(
|
||||||
X::GroupAlgebraElement{T},
|
X::GroupRingElem{T}, Y::GroupRingElem{S})
|
||||||
Y::GroupAlgebraElement{S})
|
warn("Multiplying elements with different base rings!")
|
||||||
S == T || warn("Multiplying elements with different base rings!")
|
return group_star_multiplication(promote(X,Y)...)
|
||||||
return group_star_multiplication(promote(X,Y)...)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
(*){T<:Number, S<:Number}(X::GroupAlgebraElement{T},
|
(*)(X::GroupRingElem, Y::GroupRingElem) = group_star_multiplication(X,Y)
|
||||||
Y::GroupAlgebraElement{S}) = group_star_multiplication(X,Y);
|
|
||||||
|
|
||||||
(*){T<:Number}(a::T, X::GroupAlgebraElement{T}) = GroupAlgebraElement(
|
(*){T<:Number}(a::T, X::GroupAlgebraElement{T}) = GroupAlgebraElement(
|
||||||
a*X.coefficients, X.product_matrix)
|
a*X.coefficients, X.product_matrix)
|
||||||
|
Loading…
Reference in New Issue
Block a user