npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::RandomSequenceRepeater Class Reference

#include <RandomSequenceRepeater.hh>

Inheritance diagram for npstat::RandomSequenceRepeater:
npstat::AbsRandomGenerator

Public Member Functions

 RandomSequenceRepeater (AbsRandomGenerator &original)
 
unsigned dim () const
 
double operator() ()
 
void run (double *buf, const unsigned bufLen, const unsigned nPt)
 
void repeat ()
 
void clear ()
 
void skip (unsigned long nSkip)
 
- Public Member Functions inherited from npstat::AbsRandomGenerator
virtual unsigned long long maxPoints () const
 

Detailed Description

This class remembers and repeats a random sequence.

Use method "repeat()" to rewind to the beginning of the sequence.

Use method "skip(...)" to skip an arbitrary number of sequence points.

Use method "run(..)", as usual, to get the points. The class will either call an underlying generator (when the number of "run" calls exceeds the length of stored sequence) or, after at least one rewind, will return a member of the stored sequence, as appropriate.

Member Function Documentation

◆ dim()

unsigned npstat::RandomSequenceRepeater::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.

◆ operator()()

double npstat::RandomSequenceRepeater::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()

void npstat::RandomSequenceRepeater::run ( double *  buf,
const unsigned  bufLen,
const 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.


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