Example #1
0
        public void ImageTest()
        {
            var group = new PermutationGroup(new Cycle(new [] { 0, 1 }, new [] { 2, 3 }, new [] { 4, 5 }, new [] { 6, 7 }, new [] { 8, 9 }));

            CollectionAssert.AreEqual(new Image <string>(new [] { "B", "A", "D", "C", "F", "E", "H", "G", "J", "I" }),
                                      group.Apply(0, new Image <string>(new [] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" })));
        }
Example #2
0
        public void CycleTest()
        {
            var group = new PermutationGroup(new Cycle(new [] { 0, 1 }, new [] { 2, 3 }, new [] { 4, 5 }, new [] { 6, 7 }, new [] { 8, 9 }));

            CollectionAssert.AreEqual(new [] { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8 }, group.Apply(0, new Points(new [] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 })));
        }
Example #3
0
        public void PointsTest()
        {
            var group = new PermutationGroup(new Cycle(new [] { 0, 1 }, new [] { 2, 3 }, new [] { 4, 5 }, new [] { 6, 7 }, new [] { 8, 9 }));

            CollectionAssert.AreEqual(new Points(new [] { 2, 4, 3 }), group.Apply(0, new Points(new [] { 3, 5, 2 })));
        }