|
OpenQMC API
|

Go to the source code of this file.
Functions | |
| constexpr std::uint32_t | oqmc::rotate (std::uint32_t value, std::uint32_t distance) |
| Rotate an integer a given distance. | |
| constexpr std::uint32_t | oqmc::latticeReversedIndex (std::uint32_t index, int dimension) |
| Compute a rank 1 lattice value at an index with reversed bits. | |
| template<int Depth> | |
| constexpr void | oqmc::shuffledRotatedLattice (std::uint32_t index, std::uint32_t patternId, std::uint32_t sample[Depth]) |
| Compute a randomised rank 1 lattice value. | |
An implementation of a rank 1 lattice as described in 'Weighted Compound Integration Rules with Higher Order Convergence for all N' by Fred J. Hickernell, et al., made progressive with a radical inversion of the sample index.
|
constexpr |
Given a 32 bit unsigned integer value, offset the value a given distance, and rely on integer overflow for the value to wrap around. When applied to elements in a lattice, this represents a toroidal shift or rotation, upon the range of representable values. When the distance is constant for all elements, this can be used to efficiently randomise the values.
| [in] | value | Integer value to offset. |
| [in] | distance | Distance to offset value. |

|
constexpr |
Given a 32 bit index, where the order of bits in the index have been reversed, compute a rank 1 lattice value to 32 bits of precision for a given dimension. Dimensions must be within the range [0, 4).
| [in] | index | Bit reversed index of element. |
| [in] | dimension | Dimension of rank 1 lattice. |

|
constexpr |
Given an index and a patternId, compute a rank 1 lattice value. The index will be shuffled in a manner that is progressive friendly. The value can be multi-dimensional. For a given lattice, the patternId value must be constant.
| Depth | Dimensional space of output, up to 4 dimensions. |
| [in] | index | Input index of lattice value. |
| [in] | patternId | Seed to randomise the lattice. |
| [out] | sample | Randomised lattice value. |
