Skip to content

Commit

Permalink
Add OnTuplesDigraphs and OnSetsDigraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Mar 26, 2021
1 parent 3026304 commit 3ce296f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions gap/digraph.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DeclareCategory("IsDigraphWithAdjacencyFunction", IsDigraph);
DeclareCategory("IsCayleyDigraph", IsDigraph);
DeclareCategory("IsImmutableDigraph", IsDigraph);
DeclareSynonym("IsMutableDigraph", IsDigraph and IsMutable);
DeclareCategoryCollections("IsDigraph");

DeclareAttribute("DigraphMutabilityFilter", IsDigraph);

Expand Down
2 changes: 2 additions & 0 deletions gap/oper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ DeclareGlobalFunction("DIGRAPHS_CombinationOperProcessArgs");
# 4. Actions . . .
DeclareOperation("OnDigraphs", [IsDigraph, IsPerm]);
DeclareOperation("OnDigraphs", [IsDigraph, IsTransformation]);
DeclareOperation("OnTuplesDigraphs", [IsDigraphCollection, IsPerm]);
DeclareOperation("OnSetsDigraphs", [IsDigraphCollection, IsPerm]);
DeclareOperation("OnMultiDigraphs", [IsDigraph, IsPermCollection]);
DeclareOperation("OnMultiDigraphs", [IsDigraph, IsPerm, IsPerm]);

Expand Down
12 changes: 12 additions & 0 deletions gap/oper.gi
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,18 @@ function(D, t)
return MakeImmutable(OnDigraphs(DigraphMutableCopy(D), t));
end);

# TODO DigraphByOutNeighboursColl
InstallMethod(OnTuplesDigraphs,
"for list of digraphs and a perm",
[IsDigraphCollection and IsList, IsPerm],
{L, p} -> List(L, D -> OnDigraphs(D, p)));

# TODO DigraphByOutNeighboursColl
InstallMethod(OnSetsDigraphs,
"for a set of digraphs and a perm",
[IsDigraphCollection and IsSet, IsPerm],
{S, p} -> Set(S, D -> OnDigraphs(D, p)));

# Not revising the following because multi-digraphs are being withdrawn in the
# near future.

Expand Down
25 changes: 25 additions & 0 deletions tst/standard/oper.tst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,31 @@ gap> gr := OnDigraphs(gr, t);
gap> OutNeighbours(gr);
[ [ 2 ], [ 1, 1 ], [ ] ]

# OnTuplesDigraphs: for a digraph and a permutation
gap> D := [ChainDigraph(3), CycleDigraph(4)];;
gap> List(D, OutNeighbours);
[ [ [ 2 ], [ 3 ], [ ] ], [ [ 2 ], [ 3 ], [ 4 ], [ 1 ] ] ]
gap> List(OnTuplesDigraphs(D, (1, 3)), OutNeighbours);
[ [ [ ], [ 1 ], [ 2 ] ], [ [ 4 ], [ 1 ], [ 2 ], [ 3 ] ] ]
gap> D := [ChainDigraph(3), DigraphReverse(ChainDigraph(3))];;
gap> List(D, OutNeighbours);
[ [ [ 2 ], [ 3 ], [ ] ], [ [ ], [ 1 ], [ 2 ] ] ]
gap> List(OnTuplesDigraphs(D, (1, 3)), OutNeighbours);
[ [ [ ], [ 1 ], [ 2 ] ], [ [ 2 ], [ 3 ], [ ] ] ]
gap> OnTuplesDigraphs(D, (1, 3)) = Permuted(D, (1, 2));
true

# OnSetsDigraphs: for a digraph and a permutation
gap> D := [ChainDigraph(3), DigraphReverse(ChainDigraph(3))];;
gap> IsSet(D);
true
gap> OnSetsDigraphs(D, (1, 3)) = D;
true
gap> OnSetsDigraphs(D, (1, 3)) = OnTuplesDigraphs(D, (1, 3));
false
gap> MinimalGeneratingSet(Stabilizer(SymmetricGroup(3), D, OnSetsDigraphs));
[ (1,3) ]

# OnMultiDigraphs: for a pair of permutations
gap> gr1 := CompleteDigraph(3);
<immutable complete digraph with 3 vertices>
Expand Down

0 comments on commit 3ce296f

Please sign in to comment.