N | I | number of items: there will be N! permutations |
---|---|---|
ISTATE | I(N) | state, ISTATE(1)=-1 to initialize |
ISTATE | I(N) | state, updated ready for next time |
---|---|---|
IORDER | I(N) | next permutation of numbers 1,2,...,N |
J | I | status: |
-1 = illegal N (zero or less is illegal) | ||
0 = OK | ||
+1 = no more permutations available |
IORDER(1)=N, IORDER(2)=N-1, ..., IORDER(N)=1This is also the permutation returned for the ``finished'' (J=1) case. The final permutation to be generated is:
IORDER(1)=1, IORDER(2)=2, ..., IORDER(N)=N
SLALIB --- Positional Astronomy Library