From 2e9535ad09e6aa2489848f51f95452d2cbfd5884 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Thu, 21 Jan 2016 11:19:14 -0600 Subject: [PATCH] Make the generators of CoxeterGroup dense. The one() element is dense because the matrix_space() is dense. By making the generators dense, it means the generators are not converted to dense matrices upon multiplication, resulting in a 2x speedup to iteration. --- src/sage/groups/matrix_gps/coxeter_group.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sage/groups/matrix_gps/coxeter_group.py b/src/sage/groups/matrix_gps/coxeter_group.py index f9a68e9983b..037e19a8223 100644 --- a/src/sage/groups/matrix_gps/coxeter_group.py +++ b/src/sage/groups/matrix_gps/coxeter_group.py @@ -266,6 +266,8 @@ def __init__(self, coxeter_matrix, base_ring, index_set): for j in range(n)}, coerce=True, copy=True) for i in range(n)] + # Make the generators dense matrices for consistancy and speed + gens = [g.dense_matrix() for g in gens] category = CoxeterGroups() # Now we shall see if the group is finite, and, if so, refine # the category to ``category.Finite()``. Otherwise the group is