示例#1
0
        public void Test_SuccessTest()
        {
            PermutationGroup group = GetCubeGroup();
            Permutation      p     = new Permutation(6, 7, 4, 5, 2, 3, 0, 1);
            int position           = group.Test(p);

            // this means p is a member of G
            Assert.IsTrue(position == group.Count);
        }
示例#2
0
        public void Test_FailureTest()
        {
            PermutationGroup group = GetCubeGroup();
            Permutation      p     = new Permutation(1, 2, 3, 4, 0, 6, 7, 5);
            int position           = group.Test(p);

            // this means p is not in G
            Assert.IsTrue(position < group.Count);
        }
示例#3
0
 public void ApplyTo(Permutation p)
 {
     foreach (var f in results)
     {
         Permutation h = f.Invert().Multiply(p);
         if (subgroup.Test(h) == parent.size)
         {
             return;
         }
     }
     results.Add(p);
     if (results.Count >= m)
     {
         this.finished = true;
     }
 }