mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-18 10:06:54 +01:00
79023426de
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@112 f6dd340e-d3f9-0310-b409-bdd246841980
32 lines
1.5 KiB
Text
32 lines
1.5 KiB
Text
hi(random_shuffle())
|
|
itemization(
|
|
it() Header file:
|
|
centt(#include <algorithm>)
|
|
it() Function prototypes:
|
|
itemization(
|
|
itt(void random_shuffle(RandomAccessIterator first,
|
|
RandomAccessIterator last);)
|
|
itt(void random_shuffle+OPENPARRandomAccessIterator first,
|
|
RandomAccessIterator last,)linebreak()
|
|
tt(RandomNumberGenerator rand+CLOSEPAR;)
|
|
)
|
|
it() Description:
|
|
itemization(
|
|
it() The first prototype: the elements in the range rangett(first,
|
|
last) are randomly reordered.
|
|
it() The second prototype: The elements in the range
|
|
rangett(first, last) are randomly reordered using the tt(rand)
|
|
i(random number generator), which should return an tt(int) in the range
|
|
rangett(0, remaining), where tt(remaining) is passed as argument to the
|
|
ti(operator()()) of the tt(rand) function object. Alternatively, the random
|
|
number generator may be a function expecting an tt(int remaining) parameter
|
|
and returning an tt(int) randomvalue in the range rangett(0, remaining). Note
|
|
that when a function object is used, it cannot be an anonymous object. The
|
|
function in the example uses a procedure outlined in em(Press et al.) (1992)
|
|
hi(Press, W.H.) hi(Numerical Recipes in C) bf(Numerical Recipes in C: The
|
|
Art of Scientific Computing) (New York: Cambridge University Press, (2nd ed.,
|
|
p. 277)).
|
|
)
|
|
it() Example:
|
|
verbinclude(stl/cc/randomshuffle.cc)
|
|
)
|