Exemplo n.º 1
0
 static public void WriteCompositionOfTranposition2(int[] permutation)
 {
     int[][] cyclePermutation = WithoutRepetition.PermutationToCycle(permutation);
     int[][] transpositions   = WithoutRepetition.PermutationToCompositionOfTranpositions2(permutation);
     using (StreamWriter writer = new StreamWriter("log.txt", true))
     {
         WriteCycle(writer, cyclePermutation);
         Write(writer, "=");
         for (int i = 0; i < transpositions.Length - 1; i++)
         {
             int[][] cycleTransposition = WithoutRepetition.PermutationToCycle(transpositions[i]);
             WriteTransposition(writer, cycleTransposition);
             Write(writer, "*");
         }
         int[][] cycleTranspositionLast = WithoutRepetition.PermutationToCycle(transpositions[transpositions.Length - 1]);
         WriteTransposition(writer, cycleTranspositionLast);
         WriteLine(writer); WriteLine(writer);
     }
 }