From 7c391dd492974578d3b577cde6fc4576c4b1e4bf Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Wed, 23 Aug 2017 17:00:19 +0100 Subject: [PATCH] fropin: fix performance of Left/RightCayleyDigraph Previously we did Digraph(EN_SEMI_RIGHT_CAYLEY_GRAPH(S)) which involved copying the output of EN_SEMI_RIGHT_CAYLEY_GRAPH(S), and performing checks that the output was valid. We make the output of EN_SEMI_RIGHT_CAYLEY_GRAPH(S) immutable, and use DigraphNC to avoid these unnecessary checks. This seems to resolve Issue #356. --- gap/main/fropin.gi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gap/main/fropin.gi b/gap/main/fropin.gi index 2f34fc836e..5fbf1f595e 100644 --- a/gap/main/fropin.gi +++ b/gap/main/fropin.gi @@ -577,7 +577,7 @@ function(S) ErrorNoReturn("Semigroups: RightCayleyDigraph: usage,\n", "the first argument (a semigroup) must be finite,"); fi; - digraph := Digraph(EN_SEMI_RIGHT_CAYLEY_GRAPH(S)); + digraph := DigraphNC(MakeImmutable(EN_SEMI_RIGHT_CAYLEY_GRAPH(S))); SetFilterObj(digraph, IsCayleyDigraph); SetSemigroupOfCayleyDigraph(digraph, S); SetGeneratorsOfCayleyDigraph(digraph, GeneratorsOfSemigroup(S)); @@ -602,7 +602,7 @@ function(S) ErrorNoReturn("Semigroups: LeftCayleyDigraph: usage,\n", "the first argument (a semigroup) must be finite,"); fi; - digraph := Digraph(EN_SEMI_LEFT_CAYLEY_GRAPH(S)); + digraph := DigraphNC(MakeImmutable(EN_SEMI_LEFT_CAYLEY_GRAPH(S))); SetFilterObj(digraph, IsCayleyDigraph); SetSemigroupOfCayleyDigraph(digraph, S); SetGeneratorsOfCayleyDigraph(digraph, GeneratorsOfSemigroup(S));