g05nc performs a pseudorandom permutation of a vector of integers.
public static void g05nc( int indx, int n, G05..::..G05State g05state, out int ifail )
Public Shared Sub g05nc ( _ indx As Integer(), _ n As Integer, _ g05state As G05..::..G05State, _ <OutAttribute> ByRef ifail As Integer _ )
public: static void g05nc( array<int>^ indx, int n, G05..::..G05State^ g05state, [OutAttribute] int% ifail )
static member g05nc : indx : int * n : int * g05state : G05..::..G05State * ifail : int byref -> unit
- Type: array<System..::..Int32>()An array of size [n]On entry: the integer values to be permuted.On exit: the permuted integer values.
- Type: System..::..Int32On entry: the number of values to be permuted.Constraint: .
g05nc permutes 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 methods (G05KFF not in this release) (for a repeatable sequence if computed sequentially) or (G05KGF not in this release) (for a non-repeatable sequence) must be called prior to the first call to g05nc.
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
Errors or warnings detected by the method:
- On entry, .
On entry, state vector was not initialized or has been corrupted.