14 June 2018 07:33:03 AM UNICYCLE_TEST C version Test the UNICYCLE library. PERM_IS_UNICYCLE_TEST PERM_IS_UNICYCLE determines whether a permutation is a unicyle This permutation is a unicycle 0 1 2 3 4 2 5 1 3 4 The permutation in sequence form 1 2 5 4 3 This permutation is NOT a unicycle 0 1 2 3 4 1 3 2 4 5 This permutation is NOT a unicycle 0 1 2 3 4 1 3 4 5 2 This permutation is NOT a unicycle 0 1 2 3 4 1 5 4 3 2 This permutation is NOT a unicycle 0 1 2 3 4 5 1 3 4 2 This permutation is NOT a unicycle 0 1 2 3 4 5 2 4 1 3 This permutation is NOT a unicycle 0 1 2 3 4 4 1 5 2 3 This permutation is NOT a unicycle 0 1 2 3 4 3 2 5 4 1 This permutation is NOT a unicycle 0 1 2 3 4 3 1 4 2 5 This permutation is NOT a unicycle 0 1 2 3 4 4 2 3 5 1 UNICYCLE_ENUM_TEST UNICYCLE_ENUM enumerates the unicycles of N objects. N Number 0 1 1 1 2 1 3 2 4 6 5 24 6 120 7 720 8 5040 9 40320 10 362880 UNICYCLE_INDEX_TEST UNICYCLE_INDEX converts a unicycle to index form. The unicycle: 1 3 6 2 4 5 The index form: 1 2 3 4 5 6 3 4 6 5 1 2 The unicycle recovered: 1 3 6 2 4 5 The unicycle: 1 2 4 3 5 6 The index form: 1 2 3 4 5 6 2 4 5 3 6 1 The unicycle recovered: 1 2 4 3 5 6 The unicycle: 1 2 4 5 6 3 The index form: 1 2 3 4 5 6 2 4 1 5 6 3 The unicycle recovered: 1 2 4 5 6 3 The unicycle: 1 2 6 5 4 3 The index form: 1 2 3 4 5 6 2 6 1 3 4 5 The unicycle recovered: 1 2 6 5 4 3 The unicycle: 1 6 2 4 5 3 The index form: 1 2 3 4 5 6 6 4 1 5 3 2 The unicycle recovered: 1 6 2 4 5 3 UNICYCLE_INDEX_TO_SEQUENCE_TEST UNICYCLE_INDEX_TO_SEQUENCE converts an index to unicycle form. The unicycle: 1 3 6 2 4 5 The index form: 1 2 3 4 5 6 3 4 6 5 1 2 The unicycle recovered: 1 3 6 2 4 5 The unicycle: 1 2 4 3 5 6 The index form: 1 2 3 4 5 6 2 4 5 3 6 1 The unicycle recovered: 1 2 4 3 5 6 The unicycle: 1 2 4 5 6 3 The index form: 1 2 3 4 5 6 2 4 1 5 6 3 The unicycle recovered: 1 2 4 5 6 3 The unicycle: 1 2 6 5 4 3 The index form: 1 2 3 4 5 6 2 6 1 3 4 5 The unicycle recovered: 1 2 6 5 4 3 The unicycle: 1 6 2 4 5 3 The index form: 1 2 3 4 5 6 6 4 1 5 3 2 The unicycle recovered: 1 6 2 4 5 3 UNICYCLE_INVERSE_TEST UNICYCLE_INVERSE inverts a unicycle; The original unicycle: 1 7 6 2 4 3 5 The inverse unicycle: 1 5 3 4 2 6 7 UNICYCLE_NEXT_TEST UNICYCLE_NEXT generates unicycles in lex order. UNICYCLE_RANDOM_TEST UNICYCLE_RANDOM produces a random unicyle For this test, N = 5 1 2 5 3 4 1 3 2 4 5 1 2 4 3 5 1 3 5 2 4 1 5 4 3 2 UNICYCLE_RANK_TEST UNICYCLE_RANK ranks a unicycle. The unicycle: 1 5 2 3 4 The rank is: 18 UNICYCLE_UNRANK_TEST UNICYCLE_UNRANK, given a rank, computes the corresponding unicycle. The requested rank is 6 The unicycle: 1 3 2 4 5 UNICYCLE_TEST Normal end of execution. 14 June 2018 07:33:03 AM