- naginterfaces.library.rand.permute(indx, statecomm)¶
permuteperforms a pseudorandom permutation of a vector of integers.
For full information please refer to the NAG Library document for g05nc
- indxint, ndarray, shape
The permuted integer values.
- (errno )
On entry, .
- (errno )
On entry, [‘state’] vector has been corrupted or not initialized.
permutepermutes the elements of an integer array without inspecting their values. Each of the possible permutations of the values may be regarded as being equally probable.
Even for modest values of it is theoretically impossible that all permutations may occur, as is likely to exceed the cycle length of any of the base generators. For practical purposes this is irrelevant, as the time necessary to generate all possible permutations is many millenia.
One of the initialization functions
init_repeat()(for a repeatable sequence if computed sequentially) or
init_nonrepeat()(for a non-repeatable sequence) must be called prior to the first call to
Kendall, M G and Stuart, A, 1969, The Advanced Theory of Statistics (Volume 1), (3rd Edition), Griffin
Knuth, D E, 1981, The Art of Computer Programming (Volume 2), (2nd Edition), Addison–Wesley