thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
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 >:

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

◆ rnd() [1/4]

template<typename Rnd >
static double ACDCGenerator::ACDCRandomTraits< Rnd >::rnd ( Rnd *  r)
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().

◆ rnd() [2/4]

template<typename Rnd >
static double ACDCGenerator::ACDCRandomTraits< Rnd >::rnd ( Rnd *  r,
double  xl,
double  xu 
)
inlinestatic

Return a flat random number in the interval ]xl,xu[.

Definition at line 57 of file ACDCTraits.h.

References ACDCGenerator::ACDCRandomTraits< Rnd >::rnd().

◆ rnd() [3/4]

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

Generate a set of random numbers.

Parameters
rthe random generator.
lan input iterator giving the lower limit of the interval of the first requested random number.
lendan input iterator marking the end of the range of requested random numbers.
uan input iterator giving the upper limit of the interval of the first requested random number.
resthe ouput iterator used to output the random numbers.

Definition at line 73 of file ACDCTraits.h.

References ACDCGenerator::ACDCRandomTraits< Rnd >::rnd().

◆ rnd() [4/4]

template<typename Rnd >
template<typename OutputIterator >
static void ACDCGenerator::ACDCRandomTraits< Rnd >::rnd ( Rnd *  r,
int  D,
OutputIterator  res 
)
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().

◆ rndBool() [1/2]

template<typename Rnd >
static bool ACDCGenerator::ACDCRandomTraits< Rnd >::rndBool ( Rnd *  r,
double  x 
)
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().

◆ rndBool() [2/2]

template<typename Rnd >
static bool ACDCGenerator::ACDCRandomTraits< Rnd >::rndBool ( Rnd *  r,
double  x,
double  y 
)
inlinestatic

Return true with probability x(x + y).

Definition at line 95 of file ACDCTraits.h.

References ACDCGenerator::ACDCRandomTraits< Rnd >::rndBool().

◆ rndInt()

template<typename Rnd >
static long ACDCGenerator::ACDCRandomTraits< Rnd >::rndInt ( Rnd *  r,
long  x 
)
inlinestatic

Return a random integer in the interval [0,x[.

Definition at line 101 of file ACDCTraits.h.

References ACDCGenerator::ACDCRandomTraits< Rnd >::rnd().


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