NAG Library Function Document nag_rand_sample_unequal (g05nec)
selects a pseudorandom sample, without replacement and allowing
for unequal probabilities. ||nag_rand_sample_unequal
(Nag_SortOrder sortorder, const double wt, const Integer ipop,
nag_rand_sample_unequal (g05nec) selects elements from either
the set of values or a supplied population vector of length .
The probability of selecting the th element is proportional to a
user-supplied weight, . Each element will appear at most once in
the sample, i.e., the sampling is done without replacement. One
of the initialization functions nag_rand_init_repeatable
(g05kfc) (for a repeatable sequence if computed sequentially) or
nag_rand_init_nonrepeatable (g05kgc) (for a non-repeatable
sequence) must be called prior to the first call to
nag_rand_sample_unequal (g05nec). sortorder – Nag_SortOrderInput
: a flag indicating the sorted status of the wt - wt is sorted
in ascending order, - wt is sorted in descending order, - wt is
unsorted and nag_rand_sample_unequal (