OpenQMC API
Loading...
Searching...
No Matches
owen.h File Reference
#include "arch.h"
#include "gpu.h"
#include "permute.h"
#include "reverse.h"
#include "rotate.h"
#include <cassert>
#include <cstdint>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::uint16_t oqmc::sobolReversedIndex (std::uint16_t index, int dimension)
 Compute sobol sequence value at an index with reversed bits.
 
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 sobol sequence value.
 

Detailed Description

An efficient implementation of Owen scrambled sobol 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.

Function Documentation

◆ sobolReversedIndex()

std::uint16_t oqmc::sobolReversedIndex ( std::uint16_t  index,
int  dimension 
)
inline

Given a 16 bit index, where the order of bits in the index have been reversed, compute a sobol sequence value to 16 bits of precision for a given dimension. Dimensions must be within the range [0, 4).

Parameters
[in]indexBit reversed index of element.
[in]dimensionDimension of sobol sequence.
Returns
Sobol sequence value.
Here is the caller graph for this function:

◆ scrambleAndReverse()

constexpr std::uint32_t oqmc::scrambleAndReverse ( std::uint32_t  value,
std::uint32_t  seed 
)
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.

Parameters
[in]valueInput integer value.
[in]seedSeed to change the permutation.
Returns
Permuted, reversed value.
Here is the caller graph for this function:

◆ shuffledScrambledSobol()

template<int Depth>
void oqmc::shuffledScrambledSobol ( std::uint32_t  index,
std::uint32_t  seed,
std::uint32_t  sample[Depth] 
)
inline

Given an index and a seed, compute an Owen scrambled sobol 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.

Template Parameters
DepthDimensional space of output, up to 4 dimensions.
Parameters
[in]indexInput index of sequence value.
[in]seedSeed to randomise the sequence.
[out]sampleRandomised sequence value.
Here is the caller graph for this function: