Tue May 20 22:43:39 2025 unicycle_test(): python version: 3.10.12 numpy version: 1.26.4 Test unicycle(). i4_modp_test() i4_modp() factors a number into a multiple M and a positive remainder R. Number Divisor Multiple Remainder 107 50 2 7 107 -50 -2 7 -107 50 -3 43 -107 -50 3 43 Repeat using Python % Operator: 107 50 2 7 107 -50 -3 -43 -107 50 -3 43 -107 -50 2 -7 i4_wrap_test(): i4_wrap() forces an integer to lie within given limits. ILO = 4 IHI = 8 I I4_WRAP(I) -10 5 -9 6 -8 7 -7 8 -6 4 -5 5 -4 6 -3 7 -2 8 -1 4 0 5 1 6 2 7 3 8 4 4 5 5 6 6 7 7 8 8 9 4 10 5 11 6 12 7 13 8 14 4 15 5 16 6 17 7 18 8 19 4 20 5 i4vec_indicator1_test(): i4vec_indicator1() returns an indicator vector. The indicator1 vector: 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 i4vec_print_test(): i4vec_print() prints an I4VEC. Here is an I4VEC: 0 91 1 92 2 93 3 94 i4vec_reverse_test(): i4vec_reverse() reverses a list of integers. Original vector: 0 0 1 14 2 21 3 0 4 1 5 30 6 8 7 22 8 21 9 30 Reversed: 0 30 1 21 2 22 3 8 4 30 5 1 6 0 7 21 8 14 9 0 perm1_check_test(): perm1_check() checks a permutation of 1,...,N. Permutation 1: 1 2 3 4 5 5 2 3 4 1 This is a permutation. Permutation 2: 1 2 3 4 5 4 1 3 0 2 This is not a permutation. Permutation 3: 1 2 3 4 5 0 2 1 3 2 This is not a permutation. perm1_enum_test(): perm1_enum() enumerates the permutations of 1,...,N. N PERM1_enum 1 1 2 2 3 6 4 24 5 120 6 720 7 5040 8 40320 9 362880 10 3628800 perm1_inverse_test(): perm1_inverse() inverts a permutation of (1,...,N) The original permutation: 1 2 3 4 5 6 7 4 3 5 1 7 6 2 The inverted permutation: 1 2 3 4 5 6 7 4 7 2 1 3 6 5 perm1_lex_next_test(): perm1_lex_next() generates 1-based permutations in lexicographic order. 0: 1 2 3 4 1: 1 2 4 3 2: 1 3 2 4 3: 1 3 4 2 4: 1 4 2 3 5: 1 4 3 2 6: 2 1 3 4 7: 2 1 4 3 8: 2 3 1 4 9: 2 3 4 1 10: 2 4 1 3 11: 2 4 3 1 12: 3 1 2 4 13: 3 1 4 2 14: 3 2 1 4 15: 3 2 4 1 16: 3 4 1 2 17: 3 4 2 1 18: 4 1 2 3 19: 4 1 3 2 20: 4 2 1 3 21: 4 2 3 1 22: 4 3 1 2 23: 4 3 2 1 perm1_lex_rank_test(): perm1_lex_rank() returns the lexicographic rank of a permutation of (1,...,N). A 1-based permutation: 1 2 3 4 4 1 3 2 Rank = 19 perm1_lex_unrank_test(): perm1_lex_unrank() returns the 1-based permutation of given lexicographic rank. Rank = 18 The corresponding permutation: 1 2 3 4 4 1 2 3 perm1_print_test(): perm1_print() prints a permutation of (1,...,N). A 1-based permutation: 1 2 3 4 5 6 7 7 2 4 1 5 3 6 perm1_random_test(): perm1_random() randomly selects a 1-based permutation. 7 5 10 3 8 6 2 9 4 1 9 1 2 5 4 6 3 7 10 8 3 1 9 2 10 4 6 8 5 7 7 4 3 6 2 8 9 10 1 5 4 2 1 9 3 10 6 7 8 5 perm1_is_unicycle_test(): perm1_is_unicycle() determines whether a 1-based permutation is a unicyle This permutation is NOT a unicycle 1 2 3 4 5 1 2 4 5 3 This permutation is NOT a unicycle 1 2 3 4 5 4 2 3 5 1 This permutation is NOT a unicycle 1 2 3 4 5 5 2 4 3 1 This permutation is NOT a unicycle 1 2 3 4 5 1 3 2 5 4 This permutation is a unicycle 1 2 3 4 5 2 4 5 3 1 The permutation in sequence form 1 2 4 3 5 This permutation is a unicycle 1 2 3 4 5 5 1 4 2 3 The permutation in sequence form 1 5 3 4 2 This permutation is NOT a unicycle 1 2 3 4 5 1 3 5 4 2 This permutation is NOT a unicycle 1 2 3 4 5 5 2 3 4 1 This permutation is NOT a unicycle 1 2 3 4 5 5 2 3 4 1 This permutation is NOT a unicycle 1 2 3 4 5 1 3 5 2 4 unicycle_check_test(): unicycle_check checks a unicycle. Candidate 1: 5 2 3 4 1 This is not a unicycle. Candidate 2: 4 1 3 0 2 This is not a unicycle. Candidate 3: 4 2 1 3 2 This is not a unicycle. Candidate 4: 2 1 4 3 5 This is not a unicycle. Candidate 5: 3 4 5 1 2 This is a unicycle! unicycle_enum_test(): unicycle_enum enumerates the unicycles of N objects. N Number 0 0 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 2 5 6 4 The index form: 1 2 3 4 5 6 3 5 2 1 6 4 The unicycle recovered: 1 3 2 5 6 4 The unicycle: 1 6 5 2 3 4 The index form: 1 2 3 4 5 6 6 3 4 1 2 5 The unicycle recovered: 1 6 5 2 3 4 The unicycle: 1 2 6 3 4 5 The index form: 1 2 3 4 5 6 2 6 4 5 1 3 The unicycle recovered: 1 2 6 3 4 5 The unicycle: 1 3 5 6 2 4 The index form: 1 2 3 4 5 6 3 4 5 1 6 2 The unicycle recovered: 1 3 5 6 2 4 The unicycle: 1 6 4 5 2 3 The index form: 1 2 3 4 5 6 6 3 1 5 2 4 The unicycle recovered: 1 6 4 5 2 3 unicycle_index_print_test(): unicycle_index_print prints a unicyle given in index form; The unicycle in index form: 1 2 3 4 5 6 7 7 1 4 5 2 3 6 unicycle_index_to_sequence_test unicycle_index_to_sequence converts an index to unicycle form. The unicycle: 1 3 6 2 5 4 The index form: 1 2 3 4 5 6 3 5 6 1 4 2 The unicycle recovered: 1 3 6 2 5 4 The unicycle: 1 5 4 2 6 3 The index form: 1 2 3 4 5 6 5 6 1 2 4 3 The unicycle recovered: 1 5 4 2 6 3 The unicycle: 1 4 2 3 6 5 The index form: 1 2 3 4 5 6 4 3 6 2 1 5 The unicycle recovered: 1 4 2 3 6 5 The unicycle: 1 5 3 4 2 6 The index form: 1 2 3 4 5 6 5 6 4 2 3 1 The unicycle recovered: 1 5 3 4 2 6 The unicycle: 1 2 3 6 5 4 The index form: 1 2 3 4 5 6 2 3 6 1 4 5 The unicycle recovered: 1 2 3 6 5 4 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. 0: 1 2 3 4 5 1: 1 2 3 5 4 2: 1 2 4 3 5 3: 1 2 4 5 3 4: 1 2 5 3 4 5: 1 2 5 4 3 6: 1 3 2 4 5 7: 1 3 2 5 4 8: 1 3 4 2 5 9: 1 3 4 5 2 10: 1 3 5 2 4 11: 1 3 5 4 2 12: 1 4 2 3 5 13: 1 4 2 5 3 14: 1 4 3 2 5 15: 1 4 3 5 2 16: 1 4 5 2 3 17: 1 4 5 3 2 18: 1 5 2 3 4 19: 1 5 2 4 3 20: 1 5 3 2 4 21: 1 5 3 4 2 22: 1 5 4 2 3 23: 1 5 4 3 2 unicycle_random_test unicycle_random produces a random unicyle; For this test, N = 5 1 4 5 3 2 1 4 2 3 5 1 2 4 5 3 1 4 3 2 5 1 2 4 5 3 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. Tue May 20 22:43:40 2025