ldsgen::Disk class

Disk sequence generator.

The Disk class is a sequence generator that generates points in a 2-dimensional space using the Disk sequence. The Disk sequence is a low-discrepancy sequence that is commonly used in quasi-Monte Carlo methods. It is generated by iterating over two different bases and calculating the fractional parts of the numbers in those bases. The Disk class keeps track of the current count and bases, and provides a pop() method that returns the next point in the sequence as a std::array<double, 2>.

Public functions

auto Disk(size_t base0, size_t base1) -> CONSTEXPR14
Construct a new Disk object.
auto pop() -> std::array< double, 2 > -> auto
pop
auto reseed(size_t seed) -> void -> CONSTEXPR14 auto
reseed

Function documentation

CONSTEXPR14 ldsgen::Disk::Disk(size_t base0, size_t base1)

Construct a new Disk object.

Parameters
base0 in
base1 in

The Disk(const size_t base0, const size_t base1) is a constructor for the Disk class. It takes two parameters base0 and base1, which are used as the bases for generating the Disk sequence. The CONSTEXPR14 keyword indicates that the constructor is constexpr, meaning it can be evaluated at compile-time if possible.

auto ldsgen::Disk::pop() -> std::array< double, 2 >

pop

Returns std::array<double, 2>

The pop() function is used to generate the next value in the sequence. For example, in the VdCorput class, pop() increments the count and calculates the Van der Corput sequence value for that count and base. In the Disk class, pop() returns the next point in the Disk sequence as a std::array<double, 2>. Similarly, in the Circle class, pop() returns the next point on the unit circle as a std::array<double, 2>. In the Sphere class, pop() returns the next point on the unit sphere as a std::array<double, 3>. And in the Sphere3Hopf class, pop() returns the next point on the 3-sphere using the Hopf fibration as a std::array<double, 4>.

CONSTEXPR14 auto ldsgen::Disk::reseed(size_t seed) -> void

reseed

Parameters
seed in

The reseed(size_t seed) function is used to reset the state of the sequence generator to a specific seed value. This allows the sequence generator to start generating the sequence from the beginning, or from a specific point in the sequence, depending on the value of the seed.