|
16 | 16 | #@local i1, i2, id, idom, in1, in2, in3, iter, j1, j2, m, m1, m2, mat, n, nbs |
17 | 17 | #@local out, out1, out2, out3, p1, p2, path, preorder, qr, r, res, rtclosure, t |
18 | 18 | #@local tclosure, u1, u2, x |
| 19 | +#@local p, q, idp, idt, M |
19 | 20 | gap> START_TEST("Digraphs package: standard/oper.tst"); |
20 | 21 | gap> LoadPackage("digraphs", false);; |
21 | 22 |
|
@@ -109,6 +110,30 @@ gap> gr := DigraphRemoveEdge(gr, [2, 1]); |
109 | 110 | gap> DigraphEdges(gr); |
110 | 111 | [ [ 1, 2 ] ] |
111 | 112 |
|
| 113 | +# Tests for digraph operator "^" (implements D ^ p and D ^ t using OnDigraphs) |
| 114 | +gap> D := CycleDigraph(5); |
| 115 | +<immutable cycle digraph with 5 vertices> |
| 116 | +gap> p := (1, 5)(2, 4);; |
| 117 | +gap> D ^ p = DigraphReverse(D); |
| 118 | +true |
| 119 | +gap> OnDigraphs(D, p) = D ^ p; |
| 120 | +true |
| 121 | +gap> idp := ();; |
| 122 | +gap> D ^ idp = D; |
| 123 | +true |
| 124 | +gap> q := (1, 2, 3, 4, 5);; |
| 125 | +gap> (D ^ q) ^ (q ^ -1) = D; |
| 126 | +true |
| 127 | +gap> t := Transformation([2, 3, 4, 5, 1]);; |
| 128 | +gap> D ^ t = OnDigraphs(D, t); |
| 129 | +true |
| 130 | +gap> idt := Transformation([1, 2, 3, 4, 5]);; |
| 131 | +gap> D ^ idt = D; |
| 132 | +true |
| 133 | +gap> M := DigraphMutableCopy(D);; |
| 134 | +gap> M ^ p = OnDigraphs(M, p); |
| 135 | +true |
| 136 | + |
112 | 137 | # OnDigraphs: for a digraph and a perm |
113 | 138 | gap> gr := Digraph([[2], [1], [3]]); |
114 | 139 | <immutable digraph with 3 vertices, 3 edges> |
|
0 commit comments