public class StratifiedSampling extends Object
| Constructor and Description |
|---|
StratifiedSampling(long seed)
Create a new instance of
StratifiedSampling and initialize the random number generator with the given
seed. |
| Modifier and Type | Method and Description |
|---|---|
void |
generateCentered(int n,
float centering,
Callback2d callback)
Generate
n * n random sample positions in the unit square of x, y = [-1..+1]. |
void |
generateRandom(int n,
Callback2d callback)
Generate
n * n random sample positions in the unit square of x, y = [-1..+1]. |
public StratifiedSampling(long seed)
StratifiedSampling and initialize the random number generator with the given
seed.seed - the seed to initialize the random number generator withpublic void generateRandom(int n,
Callback2d callback)
n * n random sample positions in the unit square of x, y = [-1..+1].
Each sample within its stratum is distributed randomly.
n - the number of strata in each dimensioncallback - will be called for each generated sample positionpublic void generateCentered(int n,
float centering,
Callback2d callback)
n * n random sample positions in the unit square of x, y = [-1..+1].
Each sample within its stratum is confined to be within [-centering/2..1-centering] of its stratum.
n - the number of strata in each dimensioncentering - determines how much the random samples in each stratum are confined to be near the center of the
stratum. Possible values are [0..1]callback - will be called for each generated sample positionCopyright © 2015–2019 JOML. All rights reserved.