npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::AbsRandomGenerator Struct Referenceabstract

#include <AbsRandomGenerator.hh>

Inheritance diagram for npstat::AbsRandomGenerator:
npstat::CPP11RandomGen< RandomEngine > npstat::EquidistantSampler1D npstat::MersenneTwister npstat::RandomSequenceRepeater npstat::RegularSampler1D npstat::SobolGenerator npstat::WrappedRandomGen npstat::HOSobolGenerator

Public Member Functions

virtual unsigned dim () const =0
 
virtual unsigned long long maxPoints () const
 
virtual double operator() ()=0
 
virtual void run (double *buf, const unsigned bufLen, const unsigned nPt)
 

Detailed Description

Interface class for pseudo- and quasi-random number generators.

While implementing this interface, multivariate generators should override "run" and "operator()" while 1-d generators should just override "operator()". In multivariate contexts, one should always use "run" rather than "operator()".

Member Function Documentation

◆ dim()

virtual unsigned npstat::AbsRandomGenerator::dim ( ) const
pure virtual

Dimensionality of the generated vectors (or points). It is expected that "dim()" will always be 1 for pseudo-random (as opposed to quasi-random) generators.

Implemented in npstat::SobolGenerator, npstat::RegularSampler1D, npstat::RandomSequenceRepeater, npstat::MersenneTwister, npstat::HOSobolGenerator, npstat::EquidistantSampler1D, npstat::CPP11RandomGen< RandomEngine >, and npstat::WrappedRandomGen.

◆ maxPoints()

virtual unsigned long long npstat::AbsRandomGenerator::maxPoints ( ) const
inlinevirtual

Maximum number of points which can be meaningfully produced by this generator (this is usually the generator period). If 0 is returned, it means that this number is larger than the maximum value of unsigned long long (which is typically 2^64 - 1). Override as necessary.

Reimplemented in npstat::SobolGenerator, and npstat::EquidistantSampler1D.

◆ operator()()

virtual double npstat::AbsRandomGenerator::operator() ( )
pure virtual

Standard 1-d generator function. It should generate a run-time error for essentially multivariate generators whose dimensionality is larger than 1.

Implemented in npstat::SobolGenerator, npstat::RegularSampler1D, npstat::RandomSequenceRepeater, npstat::MersenneTwister, npstat::EquidistantSampler1D, npstat::CPP11RandomGen< RandomEngine >, and npstat::WrappedRandomGen.

◆ run()

virtual void npstat::AbsRandomGenerator::run ( double *  buf,
const unsigned  bufLen,
const unsigned  nPt 
)
inlinevirtual

Generate a bunch of points. Multivariate generators must override this. Here, the effective dimensionality of the generator is bufLen/nPt.

Reimplemented in npstat::SobolGenerator, npstat::HOSobolGenerator, and npstat::RandomSequenceRepeater.


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