From 24312ee9723fc160117558cb9be7b11d6af84b39 Mon Sep 17 00:00:00 2001 From: kalmar Date: Fri, 21 Jul 2017 17:16:38 +0200 Subject: [PATCH] slowly update RG.pm as multiplication happens --- src/GroupRings.jl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index fe82a9f..6f2fe0d 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -373,15 +373,17 @@ function mul!{T}(result::GroupRingElem{T}, X::GroupRingElem, Y::GroupRingElem) z = zero(T) result.coeffs .= z - for j in eachindex(Y.coeffs) + RG = parent(X) + + for j::Int in eachindex(Y.coeffs) if Y.coeffs[j] != z - for i in eachindex(X.coeffs) + for i::Int in eachindex(X.coeffs) if X.coeffs[i] != z - if parent(X).pm[i,j] == 0 - g = parent(X).basis[i]*parent(Y).basis[j] - parent(X).pm[i,j] = parent(X).basis_dict[g] + if RG.pm[i,j] == 0 + g::elem_type(parent(X).group) = RG.basis[i]*RG.basis[j] + RG.pm[i,j] = RG.basis_dict[g] end - result.coeffs[parent(X).pm[i,j]] += X[i]*Y[j] + result.coeffs[RG.pm[i,j]] += X[i]*Y[j] end end end