ThePEG 2.3.0
|
ACDCRandomTraits defines the interface to random number generator objects to be used by ACDCGen. More...
#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[. | |
ACDCRandomTraits defines the interface to random number generator objects to be used by ACDCGen.
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.
|
inlinestatic |
Return a flat random number in the interval ]0,1[.
Definition at line 52 of file ACDCTraits.h.
Referenced by ACDCGenerator::ACDCRandomTraits< Rnd >::rnd(), ACDCGenerator::ACDCRandomTraits< Rnd >::rndBool(), and ACDCGenerator::ACDCRandomTraits< Rnd >::rndInt().
|
inlinestatic |
Return a flat random number in the interval ]xl,xu[.
Definition at line 57 of file ACDCTraits.h.
References ACDCGenerator::ACDCRandomTraits< Rnd >::rnd().
|
inlinestatic |
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().
|
inlinestatic |
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().
|
inlinestatic |
Return true with probability x.
Definition at line 90 of file ACDCTraits.h.
References ACDCGenerator::ACDCRandomTraits< Rnd >::rnd().
Referenced by ACDCGenerator::ACDCRandomTraits< Rnd >::rndBool().
|
inlinestatic |
Return true with probability x(x + y).
Definition at line 95 of file ACDCTraits.h.
References ACDCGenerator::ACDCRandomTraits< Rnd >::rndBool().
|
inlinestatic |
Return a random integer in the interval [0,x[.
Definition at line 101 of file ACDCTraits.h.
References ACDCGenerator::ACDCRandomTraits< Rnd >::rnd().