#include <lds/lds.hpp>
template<unsigned long Base0 = 2, unsigned long Base1 = 3>
lds::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>.

*     Unit Disk:
*         *****
*      ***     ***
*    **         **
*   *             *
*   *             *  More evenly
*   *             *  distributed
*    **         **   than random
*      ***     ***
*         *****
* 

Public functions

auto Disk() -> constexpr
Construct a new Disk object.
auto pop() -> std::array< double, 2 > -> constexpr auto
Generate the next point in the unit disk.
auto peek() -> std::array< double, 2 > -> constexpr auto
Peek at the next value without advancing state.
auto skip(unsigned long n) -> void -> constexpr auto
Skip n values in the sequence.
auto reseed(const unsigned long& seed) -> void -> constexpr auto
Reset the state of the Disk sequence generator.
auto get_index() const -> unsigned long -> constexpr auto
Get current index.
auto begin() -> GeneratorIterator< Disk, std::array< double, 2 > > -> constexpr auto
Get iterator to beginning.
auto end() const -> GeneratorIterator< Disk, std::array< double, 2 > > -> constexpr auto
Get iterator to end (infinite sequence)

Function documentation

template<unsigned long Base0, unsigned long Base1>
constexpr lds::Disk<Base0, Base1>::Disk()

Construct a new Disk object.

Constructs a Disk sequence generator with the specified bases for the two dimensions.

template<unsigned long Base0, unsigned long Base1>
constexpr auto lds::Disk<Base0, Base1>::pop() -> std::array< double, 2 >

Generate the next point in the unit disk.

Returns std::array<double, 2> the next point in the unit disk

Returns the next point in the unit disk as an array of two double values.

template<unsigned long Base0, unsigned long Base1>
constexpr auto lds::Disk<Base0, Base1>::peek() -> std::array< double, 2 >

Peek at the next value without advancing state.

Returns std::array<double, 2> next point in the disk

template<unsigned long Base0, unsigned long Base1>
constexpr auto lds::Disk<Base0, Base1>::skip(unsigned long n) -> void

Skip n values in the sequence.

Parameters
in number of values to skip

template<unsigned long Base0, unsigned long Base1>
constexpr auto lds::Disk<Base0, Base1>::reseed(const unsigned long& seed) -> void

Reset the state of the Disk sequence generator.

Parameters
seed in the seed value to reset the sequence generator to

Resets the state of the sequence generator to a specific seed value.

template<unsigned long Base0, unsigned long Base1>
constexpr auto lds::Disk<Base0, Base1>::get_index() const -> unsigned long

Get current index.

Returns unsigned long current index in sequence

template<unsigned long Base0, unsigned long Base1>
constexpr auto lds::Disk<Base0, Base1>::begin() -> GeneratorIterator< Disk, std::array< double, 2 > >

Get iterator to beginning.

Returns GeneratorIterator<Disk, std::array<double, 2>>

template<unsigned long Base0, unsigned long Base1>
constexpr auto lds::Disk<Base0, Base1>::end() const -> GeneratorIterator< Disk, std::array< double, 2 > >

Get iterator to end (infinite sequence)

Returns GeneratorIterator<Disk, std::array<double, 2>>