mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-12-29 11:00:28 +01:00
fix and speed-up complete! and create_pm
This commit is contained in:
parent
ebf3644682
commit
8368608962
12
src/types.jl
12
src/types.jl
@ -189,10 +189,10 @@ function complete!(RG::GroupRing,
|
|||||||
x = RG.group()
|
x = RG.group()
|
||||||
i_old = 0
|
i_old = 0
|
||||||
|
|
||||||
for (i,j) in Iterators.ProductIterator((indX, indY))
|
for (j,i) in Iterators.ProductIterator((indY, indX))
|
||||||
if iszero(RG.pm[i,j])
|
if iszero(RG.pm[i,j])
|
||||||
if i == i_old
|
if i != i_old
|
||||||
x = ifelse(twisted, inv(RG[i]), RG[i])
|
x = (twisted ? inv(RG[i]) : RG[i])
|
||||||
i_old = i
|
i_old = i
|
||||||
end
|
end
|
||||||
RG.pm[i,j] = RG[AbstractAlgebra.mul!(res, x, RG[j])]
|
RG.pm[i,j] = RG[AbstractAlgebra.mul!(res, x, RG[j])]
|
||||||
@ -223,9 +223,11 @@ function create_pm(basis::AbstractVector{T}, basis_dict::Dict{T, <:Integer},
|
|||||||
product_matrix = zeros(Int32, limit, limit)
|
product_matrix = zeros(Int32, limit, limit)
|
||||||
|
|
||||||
Threads.@threads for i in 1:size(product_matrix, 1)
|
Threads.@threads for i in 1:size(product_matrix, 1)
|
||||||
x = ifelse(twisted, inv(basis[i]), basis[i])
|
x = (twisted ? inv(basis[i]) : basis[i])
|
||||||
|
res = parent(x)()
|
||||||
for j in 1:size(product_matrix, 2)
|
for j in 1:size(product_matrix, 2)
|
||||||
product_matrix[i,j] = basis_dict[x*basis[j]]
|
res = AbstractAlgebra.mul!(res, x, basis[j])
|
||||||
|
product_matrix[i,j] = basis_dict[res]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user