Skip to content

Commit

Permalink
fropin: fix performance of Left/RightCayleyDigraph
Browse files Browse the repository at this point in the history
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 semigroups#356.
  • Loading branch information
James Mitchell committed Aug 23, 2017
1 parent ade1763 commit 7c391dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gap/main/fropin.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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));
Expand Down

0 comments on commit 7c391dd

Please sign in to comment.