示例#1
0
        static public void WritePermutationIndexALO(int[] permutation) // ALO- anti lexicographical order
        {
            int[][] cyclePermutation = WithoutRepetition.PermutationToCycle(permutation);
            long    index            = WithoutRepetition.PermutationIndexInAntiLexOrder(permutation);

            using (StreamWriter writer = new StreamWriter("log.txt", true))
            {
                WriteDate(writer);
                WriteLine(writer, "Permutation index in anti lexicographical order: ");
                WriteLine(writer);
                Write(writer, "One-line notation: ");
                WriteVector(writer, permutation);
                WriteLine(writer);
                Write(writer, "Canonical cycle notation: ");
                WriteCycle(writer, cyclePermutation);
                WriteLine(writer);
                WriteLine(writer);
                WriteLine(writer, "Index: " + index);
                WriteLine(writer);
            }
        }