virtual Sampler* RewindableSamplerImpl::Clone |
( |
| ) |
const |
|
inlineoverridevirtual |
Clone the sampler.
- Returns
- Duplicated sampler.
Implements Sampler.
virtual void RewindableSamplerImpl::Configure |
( |
Random * |
rng | ) |
|
|
inlineoverridevirtual |
Configure the sampler. Initializes underlying random number generator with the given value. This function must be called before use. Ownership of #rng is delegated to this class. Seed is not explicitly refreshed, so do not forget to call SetSeed after calling this function before use.
- Parameters
-
Implements RewindableSampler.
virtual Math::Float RewindableSamplerImpl::Next |
( |
| ) |
|
|
inlineoverridevirtual |
Sample a floating-point value.
- Returns
- Sampled value.
Implements Sampler.
virtual unsigned int RewindableSamplerImpl::NextUInt |
( |
| ) |
|
|
inlineoverridevirtual |
Sample a unsigned integer value.
- Returns
- Sampled value.
Implements Sampler.
virtual Math::Vec2 RewindableSamplerImpl::NextVec2 |
( |
| ) |
|
|
inlineoverridevirtual |
Sample a floating-point 2d vector value.
- Returns
- Sampled value.
Implements Sampler.
virtual void RewindableSamplerImpl::Rewind |
( |
int |
index | ) |
|
|
inlineoverridevirtual |
Rewind the sampler to the given index. Moves the index of the sampler to #index and gets the sampler ready to regenerate random numbers after #index. The index values can be obtained by SampleIndex function. In the condition of the same seed, this function guarantees to generate same sequence of samples after #index.
- Parameters
-
- See also
- SampleIndex
Implements RewindableSampler.
virtual Random* RewindableSamplerImpl::Rng |
( |
| ) |
|
|
inlineoverridevirtual |
Ger underlying random number generator if available.
- Returns
- Random number generator.
Implements Sampler.
virtual int RewindableSamplerImpl::SampleIndex |
( |
| ) |
const |
|
inlineoverridevirtual |
Get the current sampler index. The value is used for rewinding the sampler.
- Returns
- Current sample index.
- See also
- Rewind
Implements RewindableSampler.
virtual void RewindableSamplerImpl::SetSeed |
( |
unsigned int |
seed | ) |
|
|
inlineoverridevirtual |
Set seed and initialize internal state. This function is valid only for
- Parameters
-
Implements Sampler.
The documentation for this class was generated from the following file:
- /home/travis/build/hi2p-perim/lightmetrica/src/liblightmetrica/rewindablesampler.cpp