// output of ./demo/comb/signed-perm-gray-demo.cc: // Description: //% Signed permutations (hyperoctahedral group), Gray code. //% Every second signed permutation in the list is a pure rotation. //% There are n! * 2^n signed permutations of n elements. //% We flip a sign most often, the number of transpositions is minimal, as in //% James F. Korsh, Paul S. LaFollette: A loopless Gray code for rooted trees, //% ACM Transactions on Algorithms, vol.2, no.2, pp.135-152, (April-2006). arg 1: 3 == n [Signed permutations of n elements.] default=3 0: (+1, +2, +3) R 1: (-1, +2, +3) F 2: (-1, -2, +3) R 3: (+1, -2, +3) F 4: (+1, -2, -3) R 5: (-1, -2, -3) F 6: (-1, +2, -3) R 7: (+1, +2, -3) F 8: (+2, +1, -3) R 9: (-2, +1, -3) F 10: (-2, -1, -3) R 11: (+2, -1, -3) F 12: (+2, -1, +3) R 13: (-2, -1, +3) F 14: (-2, +1, +3) R 15: (+2, +1, +3) F 16: (+2, +3, +1) R 17: (-2, +3, +1) F 18: (-2, -3, +1) R 19: (+2, -3, +1) F 20: (+2, -3, -1) R 21: (-2, -3, -1) F 22: (-2, +3, -1) R 23: (+2, +3, -1) F 24: (+3, +2, -1) R 25: (-3, +2, -1) F 26: (-3, -2, -1) R 27: (+3, -2, -1) F 28: (+3, -2, +1) R 29: (-3, -2, +1) F 30: (-3, +2, +1) R 31: (+3, +2, +1) F 32: (+3, +1, +2) R 33: (-3, +1, +2) F 34: (-3, -1, +2) R 35: (+3, -1, +2) F 36: (+3, -1, -2) R 37: (-3, -1, -2) F 38: (-3, +1, -2) R 39: (+3, +1, -2) F 40: (+1, +3, -2) R 41: (-1, +3, -2) F 42: (-1, -3, -2) R 43: (+1, -3, -2) F 44: (+1, -3, +2) R 45: (-1, -3, +2) F 46: (-1, +3, +2) R 47: (+1, +3, +2) F ct=48