npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0

#include <SobolGenerator.hh>

Inheritance diagram for npstat::SobolGenerator:
npstat::AbsRandomGenerator npstat::HOSobolGenerator

Public Types

enum  { DIM_MAX = 1111 , LOG_MAX = 62 }
 

Public Member Functions

 SobolGenerator (unsigned dim, unsigned maxPowerOfTwo=LOG_MAX, unsigned nSkip=0U)
 
virtual unsigned dim () const
 
virtual void run (double *buf, unsigned bufSize, unsigned nPoints)
 
double operator() ()
 
unsigned long long maxPoints () const
 

Protected Member Functions

void nextBitSet (long long *buf, unsigned bufSize)
 
unsigned maxPowerOfTwo () const
 

Detailed Description

Generator of Sobol sequences. Based on the "i8_sobol" function written by John Burkardt: http://people.sc.fsu.edu/~jburkardt/cpp_src/sobol/sobol.html

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Maximum number of dimensions and maximum number of points which can be generated by this code (the latter equals pow(2,LOG_MAX))

Constructor & Destructor Documentation

◆ SobolGenerator()

npstat::SobolGenerator::SobolGenerator ( unsigned  dim,
unsigned  maxPowerOfTwo = LOG_MAX,
unsigned  nSkip = 0U 
)
explicit

Constructor arguments are as follows:

dim – dimensionality of the point set

maxPowerOfTwo – maximum number of points which can be made by this generator will be 2^maxPowerOfTwo. maxPowerOfTwo must not be less than 2 and must not exceed LOG_MAX.

nSkip – number of events to skip at the beginning in order to "warm up" the generator. Reasonable values of this argument are 2^(maxPowerOfTwo-k), with some small k > 0.

Member Function Documentation

◆ dim()

virtual unsigned npstat::SobolGenerator::dim ( ) const
inlinevirtual

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.

Implements npstat::AbsRandomGenerator.

Reimplemented in npstat::HOSobolGenerator.

◆ maxPoints()

unsigned long long npstat::SobolGenerator::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 from npstat::AbsRandomGenerator.

◆ operator()()

double npstat::SobolGenerator::operator() ( )
virtual

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

Implements npstat::AbsRandomGenerator.

◆ run()

virtual void npstat::SobolGenerator::run ( double *  buf,
unsigned  bufLen,
unsigned  nPt 
)
virtual

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

Reimplemented from npstat::AbsRandomGenerator.

Reimplemented in npstat::HOSobolGenerator.


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