Skip to content

Commit

Permalink
Add GB_RefinerFromConstraint
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Dec 21, 2021
1 parent 4154177 commit aa1e2a3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
36 changes: 36 additions & 0 deletions gap/refiners.gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
GB_RefinerFromConstraint := function(con)
local action, source, result;

if HasIsEmptyConstraint(con) and IsEmptyConstraint(con) then
return BTKit_Refiner.Nothing();

# TODO Deal properly with InSymmetricGroup

elif IsInCosetByGensConstraint(con) then
return GB_Con.InCoset(UnderlyingGroup(con), Representative(con));

elif IsTransporterConstraint(con) then
action := ActionFunc(con);
source := SourceObject(con);
result := ResultObject(con);

# TODO Should have a digraph transporter refiner

if action = OnPoints and IsPerm(source) then
return GB_Con.PermConjugacy(source, result);

elif action = OnTuples and ForAll(source, IsPerm) then
return List([1 .. Length(source)], i -> GB_Con.PermConjugacy(source[i], result[i]));

elif action = OnPoints and IsPermGroup(source) then
return GB_Con.GroupConjugacySimple2(source, result);

elif action = OnSetsDigraphs and ForAll(source, IsDigraph) then
return GB_Con.SetDigraphs(source, result);

fi;

fi;

return BTKit_RefinerFromConstraint(con);
end;
2 changes: 2 additions & 0 deletions read.g
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ ReadPackage( "GraphBacktracking", "gap/constraints/normaliser.g");
ReadPackage( "GraphBacktracking", "gap/constraints/canonicalconstraints.g");
ReadPackage( "GraphBacktracking", "gap/constraints/conjugacy.g");
ReadPackage( "GraphBacktracking", "gap/constraints/digraphs.g");
ReadPackage( "GraphBacktracking", "gap/refiners.gi");

0 comments on commit aa1e2a3

Please sign in to comment.