#include <ACDCTraits.h>
Static Public Member Functions | |
static double | rnd (Rnd *r) |
Return a flat random number in the interval ]0,1[. | |
static double | rnd (Rnd *r, double xl, double xu) |
Return a flat random number in the interval ]xl,xu[. | |
template<typename InputIterator, typename OutputIterator> | |
static void | rnd (Rnd *r, InputIterator l, InputIterator lend, InputIterator u, OutputIterator res) |
Generate a set of random numbers. | |
template<typename OutputIterator> | |
static void | rnd (Rnd *r, int D, OutputIterator res) |
Generate D random numbers. | |
static bool | rndBool (Rnd *r, double x) |
Return true with probability x. | |
static bool | rndBool (Rnd *r, double x, double y) |
Return true with probability x(x + y). | |
static long | rndInt (Rnd *r, long x) |
Return a random integer in the interval [0,x[. |
If this default implementation is not suitable, ACDCRandomTraits may be specialized for any class as long as functions with the same signature are present.
Definition at line 47 of file ACDCTraits.h.
static void ACDCGenerator::ACDCRandomTraits< Rnd >::rnd | ( | Rnd * | r, | |
InputIterator | l, | |||
InputIterator | lend, | |||
InputIterator | u, | |||
OutputIterator | res | |||
) | [inline, static] |
Generate a set of random numbers.
r | the random generator. | |
l | an input iterator giving the lower limit of the interval of the first requested random number. | |
lend | an input iterator marking the end of the range of requested random numbers. | |
u | an input iterator giving the upper limit of the interval of the first requested random number. | |
res | the ouput iterator used to output the random numbers. |
Definition at line 73 of file ACDCTraits.h.
References ACDCGenerator::ACDCRandomTraits< Rnd >::rnd().
static void ACDCGenerator::ACDCRandomTraits< Rnd >::rnd | ( | Rnd * | r, | |
int | D, | |||
OutputIterator | res | |||
) | [inline, static] |
Generate D random numbers.
The numbers are put into the OutputIterator res.
Definition at line 83 of file ACDCTraits.h.
References ACDCGenerator::ACDCRandomTraits< Rnd >::rnd().