Skip to content

Commit

Permalink
Tweak generic coset Intersection2
Browse files Browse the repository at this point in the history
Add a heuristic to fall back to the previous method if it is cheap
  • Loading branch information
fingolfin committed May 10, 2022
1 parent de02633 commit acda2a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/csetgrp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,11 @@ InstallMethod(Intersection2, "general cosets", IsIdenticalObj,
[IsRightCoset,IsRightCoset],
function(cos1,cos2)
local swap, H1, H2, x1, x2, sigma, U, rho;
if Size(cos1) < 10 then
TryNextMethod();
elif Size(cos2) < 10 then
return Intersection2(cos2, cos1);
fi;
if Size(cos1) > Size(cos2) then
swap := cos1;
cos1 := cos2;
Expand All @@ -803,7 +808,7 @@ function(cos1,cos2)
x1:=Representative(cos1);
x2:=Representative(cos2);
sigma := x1 / x2;
if H1 = H2 then
if Size(H1) = Size(H2) and H1 = H2 then
if sigma in H1 then
return cos1;
else
Expand Down

0 comments on commit acda2a9

Please sign in to comment.