g05ejf
g05ejf
© Numerical Algorithms Group, 2002.
Purpose
G05EJF Pseudo-random sample from an integer vector
Synopsis
[ib,ifail] = g05ejf(ia,m<,ifail>)
Description
The routine selects m elements from vector IA of length n and
places them in vector IB. Their order in IA will be preserved in
(n)
IB. Each of the (m) possible combinations of elements of IA may
be regarded as being equiprobable.
If n is greater than 60, it is theoretically impossible that all
combinations of size m may occur, unless m is near 1 or near n.
(n)
This is because (m) exceeds the cycle length of G05CAF. For
practical purposes this is irrelevant, as the time taken to
generate all possible combinations is many millenia.
Parameters
g05ejf
Required Input Arguments:
ia (:) integer
m integer
Optional Input Arguments: <Default>
ifail integer -1
Output Arguments:
ib (m) integer
ifail integer