mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-30 10:00:28 +01:00
The performant version of group_star_multiplication
This commit is contained in:
parent
5dc0dff3ff
commit
5bc90f49e1
@ -64,15 +64,17 @@ function group_star_multiplication{T<:Number}(X::GroupAlgebraElement{T},
|
|||||||
X.product_matrix == Y.product_matrix || ArgumentError(
|
X.product_matrix == Y.product_matrix || ArgumentError(
|
||||||
"Elements don't seem to belong to the same Group Algebra!")
|
"Elements don't seem to belong to the same Group Algebra!")
|
||||||
result = zeros(X.coordinates)
|
result = zeros(X.coordinates)
|
||||||
for (i,x) in enumerate(X.coordinates), (j,y) in enumerate(Y.coordinates)
|
for (i,x) in enumerate(X.coordinates)
|
||||||
if x*y == 0
|
if x != 0
|
||||||
nothing
|
for (j,y) in enumerate(Y.coordinates)
|
||||||
else
|
if y != 0
|
||||||
index = X.product_matrix[i,j]
|
index = X.product_matrix[i,j]
|
||||||
if index == 0
|
if index == 0
|
||||||
throw(ArgumentError("The product don't seem to belong to the span of basis!"))
|
throw(ArgumentError("The product don't seem to belong to the span of basis!"))
|
||||||
else
|
else
|
||||||
result[index]+= x*y
|
result[index]+= x*y
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user