ACDCGenerator::ACDCRandomTraits< Rnd > Struct Template Reference

ACDCRandomTraits defines the interface to random number generator objects to be used by ACDCGen. More...

#include <ACDCTraits.h>

Inheritance diagram for ACDCGenerator::ACDCRandomTraits< Rnd >:

ACDCGenerator::ACDCTraitsType

List of all members.

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[.


Detailed Description

template<typename Rnd>
struct ACDCGenerator::ACDCRandomTraits< Rnd >

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.


Member Function Documentation

template<typename Rnd>
template<typename InputIterator, typename OutputIterator>
static void ACDCGenerator::ACDCRandomTraits< Rnd >::rnd ( Rnd *  r,
InputIterator  l,
InputIterator  lend,
InputIterator  u,
OutputIterator  res 
) [inline, static]

Generate a set of random numbers.

Parameters:
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().

template<typename Rnd>
template<typename OutputIterator>
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().


The documentation for this struct was generated from the following file:

Generated on Thu Apr 29 12:42:56 2010 for ThePEG by  doxygen 1.5.5