From 6061f731b3207b554af025b646ee9015d44419e4 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Sun, 27 Aug 2017 18:32:50 +0200 Subject: [PATCH] threaded generation of matrix reps --- src/OrbitDecomposition.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/OrbitDecomposition.jl b/src/OrbitDecomposition.jl index 47fa317..e2968f0 100644 --- a/src/OrbitDecomposition.jl +++ b/src/OrbitDecomposition.jl @@ -108,14 +108,16 @@ function matrix_reps{T<:GroupElem}(G::Group, S::Vector{T}, AutS::Group, radius:: Id = (isa(G, Nemo.Ring) ? one(G) : G()) E2, _ = Groups.generate_balls(S, Id, radius=radius) Edict = GroupRings.reverse_dict(E2) - elts = collect(elements(AutS)) - mreps = Vector{SparseMatrixCSC{Int, Int}}(length(elts)) - Threads.@threads for i in 1:length(elts) + elts = collect(elements(AutS)) + l = length(elts) + mreps = Vector{SparseMatrixCSC{Int, Int}}(l) + + Threads.@threads for i in 1:l mreps[i] = PropertyT.matrix_repr(elts[i], E2, Edict) end - mreps_dict = Dict(elts[i]=>mreps[i] for i in 1:length(elts)) + mreps_dict = Dict(elts[i]=>mreps[i] for i in 1:l) return mreps_dict end