#include <lds/lds.hpp>
template<unsigned long Base = 2>
lds::Circle class

Circle sequence generator.

The Circle class is a sequence generator that generates points on a unit circle using the van der Corput sequence. It uses the VdCorput class to generate the sequence values and maps them to points on the unit circle. The pop() method returns the next point on the unit circle as a std::array<double, 2>, where the first element represents the x-coordinate and the second element represents the y-coordinate of the point. The reseed() method is used to reset the state of the sequence generator to a specific seed value.

*     Unit Circle:
*         (0,1)
*           *
*    (-1,0) *   * (1,0)
*           *
*        (0,-1)
*
*     Points distributed more evenly
*     than random sampling
* 

Public functions

auto Circle() -> constexpr
Construct a new Circle object.
auto pop() -> std::array< double, 2 > -> constexpr auto
Generate the next point on the unit circle.
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 Circle sequence generator.
auto get_index() const -> unsigned long -> constexpr auto
Get current index.
auto begin() -> GeneratorIterator< Circle, std::array< double, 2 > > -> constexpr auto
Get iterator to beginning.
auto end() const -> GeneratorIterator< Circle, std::array< double, 2 > > -> constexpr auto
Get iterator to end (infinite sequence)

Function documentation

template<unsigned long Base>
constexpr lds::Circle<Base>::Circle()

Construct a new Circle object.

Constructs a Circle sequence generator with the specified base for generating the van der Corput sequence, which is then mapped to points on the unit circle.

template<unsigned long Base>
constexpr auto lds::Circle<Base>::pop() -> std::array< double, 2 >

Generate the next point on the unit circle.

Returns std::array<double, 2> the next point on the unit circle

Returns the next point on the unit circle as an array of two double values.

template<unsigned long Base>
constexpr auto lds::Circle<Base>::peek() -> std::array< double, 2 >

Peek at the next value without advancing state.

Returns std::array<double, 2> next point on the circle

template<unsigned long Base>
constexpr auto lds::Circle<Base>::skip(unsigned long n) -> void

Skip n values in the sequence.

Parameters
in number of values to skip

template<unsigned long Base>
constexpr auto lds::Circle<Base>::reseed(const unsigned long& seed) -> void

Reset the state of the Circle 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 Base>
constexpr auto lds::Circle<Base>::get_index() const -> unsigned long

Get current index.

Returns unsigned long current index in sequence

template<unsigned long Base>
constexpr auto lds::Circle<Base>::begin() -> GeneratorIterator< Circle, std::array< double, 2 > >

Get iterator to beginning.

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

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

Get iterator to end (infinite sequence)

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