Jpp
15.0.5
the software that should make you happy
|
Template class for randomly sampling from a JLANG::JRewindableObjectIterator using a JLANG::JObjectSampler. More...
#include <JRandomSampler.hh>
Public Member Functions | |
JRandomSampler () | |
Default constructor. More... | |
JRandomSampler (const unsigned int on, const unsigned int off) | |
Constructor. More... | |
const JRandomSampler & | getRandomSampler () const |
Get random sampler. More... | |
JRandomSampler & | getRandomSampler () |
Get random sampler. More... | |
skip_type | operator() (const T &object) const |
Acceptance test operator. More... | |
Protected Attributes | |
skip_type | averageOn |
skip_type | averageOff |
skip_type | count |
Friends | |
std::istream & | operator>> (std::istream &in, JRandomSampler &sampler) |
Read random sampler from input. More... | |
std::ostream & | operator<< (std::ostream &out, const JRandomSampler &sampler) |
Write random sampler to output. More... | |
Template class for randomly sampling from a JLANG::JRewindableObjectIterator using a JLANG::JObjectSampler.
The JRandomSampler class provides for an implementation of randomly sampling objects.
The sampling is controlled via two parameters, namely:
Definition at line 33 of file JRandomSampler.hh.
|
inline |
Default constructor.
This constructor will sample all objects.
Definition at line 39 of file JRandomSampler.hh.
|
inline |
Constructor.
on | average number of consecutively accepted events |
off | average number of consecutively rejected events |
Definition at line 52 of file JRandomSampler.hh.
|
inline |
Get random sampler.
Definition at line 65 of file JRandomSampler.hh.
|
inline |
Get random sampler.
Definition at line 76 of file JRandomSampler.hh.
|
inline |
Acceptance test operator.
Return value 0 means accept and >0 number of objects to skip.
object | object |
Definition at line 89 of file JRandomSampler.hh.
|
friend |
Read random sampler from input.
in | input stream |
sampler | random sampler |
Definition at line 113 of file JRandomSampler.hh.
|
friend |
Write random sampler to output.
out | output stream |
sampler | random sampler |
Definition at line 131 of file JRandomSampler.hh.
|
protected |
Definition at line 141 of file JRandomSampler.hh.
|
protected |
Definition at line 142 of file JRandomSampler.hh.
|
mutableprotected |
Definition at line 143 of file JRandomSampler.hh.