thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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. More...
 
template<typename OutputIterator >
static void rnd (Rnd *r, int D, OutputIterator res)
 Generate D random numbers. More...
 
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/2]

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.

◆ rnd() [2/2]

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.


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