This type is used to represent the state of higher level sampler implementations. The size of the type is carefully handled to make sure it is appropriate to pass-by-value. This allows for efficient functional style use of the higher level API, an important requirement of the API design. This type also provides functionality to mutate the state when building new domains, along with the computation of generic PRNG values.
The function derives a mutated copy of the current sampler object. This new object is called a domain. Each domain produces an independent 4 dimensional pattern. Calling the draw* member functions below on the new child domain will produce a different value to that of the current parent domain.
N child domains can be derived from a single parent domain with the use of the key argument. Keys must have at least one bit difference, but can be a simple incrementing sequence. A single child domain can itself derive N child domains. This process results in a domain tree.
The calling code can use up to 4 dimensions from each domain (these are typically of the highest quality), joining them together to form an N dimensional pattern. This technique is called padding.
- Parameters
-
| [in] | key | Index key of next domain. |
- Returns
- Child domain based on the current object state and key.
Like newDomain, this function derives a mutated copy of the current sampler object. However, using a technique called splitting, this domain can have a higher sample rate based on a fixed multiplier.
The result from taking N indexed domains with this function will be both a locally and a gloablly well distributed sub-pattern. This sub-pattern will of the highest quality due to being globally correlated with the sub-patterns of other samples.
If a mutliplier is adaptive (non-constant or unknown) then either the newDomainDistrib or newDomainChain functions should be used instead. These methods relax the constraint for a fixed multiplier, allowing for adaptive multilpiers in excahnge for a reduction in the quality
Calling code should use a constant key for any given domain while then incrementing the index value N times to increase the sampling rate by N for that given domain. The function will be called N times, once for each unique index. N must be passed as 'size' and remain constant.
- Parameters
-
| [in] | key | Index key of next domain. |
| [in] | size | Sample index multiplier. Must greater than zero. |
| [in] | index | Sample index of next domain. Must be positive. |
- Returns
- Child domain based on the current object state, key and size.
Like newDomain, this function derives a mutated copy of the current sampler object. However, using a technique called splitting, this domain can have a higher sample rate based on an adaptive multiplier.
The result from taking N indexed domains with this function will be a locally well distributed sub-pattern. This sub-pattern will be of lower quality when combined with the sub-patterns of other samples. That is because the correlation between the sub-patterns globally is lost.
If a mutliplier is fixed (constant and known) then the newDomainSplit function will produce better quality sample points and should be used instead. This is because newDomainSplit will preserved correlation between sub-patterns from other samples.
Calling code should use a constant key for any given domain while then incrementing the index value N times to increase the sampling rate by N for that given domain. The function will be called N times, once for each unique index.
- Parameters
-
| [in] | key | Index key of next domain. |
| [in] | index | Sample index of next domain. Must be positive. |
- Returns
- Child domain based on the current object state and key.
| void oqmc::State64Bit::drawRnd |
( |
std::uint32_t |
rnd[Size] | ) |
const |
This can compute rnd values with up to 4 dimensions for the given domain. The operation does not change the state of the object, and for a single domain and index, the result of this function will always be the same. Output values are uniformly distributed integers within the range of [0, 2^32).
These values are of low quality but are fast to compute and have little risk of biasing an estimate. For higher quality samples, use the drawSample member functions above.
- Template Parameters
-
| Size | Number of dimensions to draw. Must be within [1, 4]. |
- Parameters
-
| [out] | rnd | Output array to store rnd values. |