|
NAG[g05ehc] NAG[nag_ran_permut_vec] - Pseudo-random permutation of an integer vector
|
|
Calling Sequence
g05ehc(index_vector, 'n'=n, 'fail'=fail)
nag_ran_permut_vec(. . .)
Parameters
|
index_vector - Vector(1..n, datatype=integer[kernelopts('wordsize')/8]);
|
|
|
On entry: the integer values to be permuted.
|
|
On exit: the permuted integer values.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the array index_vector.
|
|
On entry: the number of values to be permuted.
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_ran_permut_vec (g05ehc) performs a pseudo-random permutation of a vector of integers.
|
|
Description
|
|
nag_ran_permut_vec (g05ehc) generates a single pseudo-random permutation of the elements of index_vector without inspecting their values. Each of the ! possible permutations of the values may be regarded as being equiprobable.
|
|
Error Indicators and Warnings
|
|
"NE_INT_ARG_LT"
On entry, n must not be less than 1: .
|
|
|
Examples
|
|
>
|
n := 8:
index_vector := Vector([0, 1, 2, 3, 4, 5, 6, 7], datatype=integer[kernelopts('wordsize')/8]):
NAG:-g05cbc(0):
NAG:-g05ehc(index_vector, 'n' = n):
|
|
|
Download Help Document
Was this information helpful?