|
OpenQMC API
|
#include "gpu.h"#include "permute.h"#include "reverse.h"#include "rotate.h"#include <cassert>#include <cstdint>
Go to the source code of this file.
Functions | |
| std::uint16_t | oqmc::szReversedBasis (std::uint16_t index, int dimension) |
| Compute SZ sequence value in the reversed basis. | |
| std::uint16_t | oqmc::szToReversed (std::uint16_t index, int dimension) |
| Compute SZ sequence value from a natural order index. | |
| constexpr std::uint32_t | oqmc::scrambleAndReverse (std::uint32_t value, std::uint32_t seed) |
| Permute an input integer and reverse the bits. | |
| template<int Depth> | |
| void | oqmc::shuffledScrambledSobol (std::uint32_t index, std::uint32_t seed, std::uint32_t sample[Depth]) |
| Compute a randomised SZ sequence value. | |
An efficient implementation of Owen scrambled SZ sequences. This can be used to construct higher level sampler types. The method uses Brent Burley's hash based 'Practical Hash-based Owen Scrambling' construction with added optimisations.
|
inline |
Given a 16 bit index, where the order of bits in the index have been reversed, compute an SZ sequence value to 16 bits of precision for a given dimension, with the order of its bits also reversed. Prefer this variant on the GPU, where left shifts are more efficient than right shifts. Dimensions must be within the range [0, 4).
| [in] | index | Bit reversed index of element. |
| [in] | dimension | Dimension of sequence. |

|
inline |
As oqmc::szReversedBasis, but taking the index in its natural bit order, so a draw can reverse the shared index once instead of once per dimension (Chris Kulla, PR #97).
| [in] | index | Index of element. |
| [in] | dimension | Dimension of sequence. |

|
constexpr |
Given an input integer value, perform a Laine and Karras style permutation and reverse the resulting bits. The permutation can be randomised with a given seed value. This will be equivalent to an Owen scramble when the input bits of the integer are already reversed.
| [in] | value | Input integer value. |
| [in] | seed | Seed to change the permutation. |

|
inline |
Given an index and a seed, compute an Owen scrambled SZ sequence value. The index will be shuffled in a manner that is progressive friendly. The value can be multi-dimensional. For a given sequence, the seed value must be constant. An index greater than 2^16 will repeat values.
| Depth | Dimensional space of output, up to 4 dimensions. |
| [in] | index | Input index of sequence value. |
| [in] | seed | Seed to randomise the sequence. |
| [out] | sample | Randomised sequence value. |
