g05ndc selects
elements from a population vector
ipop of length
and places them in a sample vector
isampl. Their order in
ipop will be preserved in
isampl. Each of the
possible combinations of elements of
isampl may be regarded as being equally probable.
One of the initialization functions
g05kfc (for a repeatable sequence if computed sequentially) or
g05kgc (for a non-repeatable sequence) must be called prior to the first call to
g05ndc.
Not applicable.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
In order to sample other kinds of vectors, or matrices of higher dimension, the following technique may be used:
-
(a)set , for ;
-
(b)use g05ndc to take a sample from ipop and put it into isampl;
-
(c)use the contents of isampl as a set of indices to access the relevant vector or matrix.
In order to divide a population into several groups,
g05ncc is more efficient.
In the example program random samples of size
are selected from a vector containing the first eight positive integers in ascending order. The samples are generated and printed for each sample size by a call to
g05ndc after initialization by
g05kfc.
None.