PING
0.9
Statistical data handling and processing in production environment
|
Perform a pseudo-random permutation of either the elements of a list or a sequence of integers.
par
: input parameter; this can be:seed
: (option) seed of the pseudo-random numbers generator; if seed<=0, the time of day is used to initialize the seed stream; default: seed=0
; see %ranuni;sep
: (option) character/string separator in input list; default: %quote( )
, i.e. sep
is blank._list_
: output sequenced list, i.e. the length of the considered list (calculated as the number of strings separated by sep
).
Using a fixed >0
seed, it is possible to retrieve pseudo-random lists (sequence) of INTEGER values, e.g.:
(always) returns olist=9 10 1 4 3 8 7 5 6 2
, while using the same seed over some lists of NUMERIC or CHAR lists enables us to permute the items of the lists, e.g.:
return always the same lists olist=i j a d c h g e f b
and alist=1 0 -2 56 43 10 8.2 89 0.5 105
.
Run macro %_example_list_permutation
for examples.
%list_compare(&par, &olist)=0
holds.