ldsgen::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.

Public functions

auto Circle(size_t base) -> CONSTEXPR14 explicit
Construct a new Circle object.
auto pop() -> std::array< double, 2 > -> auto
pop
auto reseed(size_t seed) -> void -> CONSTEXPR14 auto
reseed

Function documentation

CONSTEXPR14 ldsgen::Circle::Circle(size_t base) explicit

Construct a new Circle object.

Parameters
base in

The Circle(size_t base) constructor is initializing a Circle object with a given base. The base is used to generate the Van der Corput sequence, which is then mapped to points on the unit circle. The explicit keyword indicates that this constructor can only be used for explicit construction and not for implicit conversions.

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

pop

Returns std::array<double, 2>

The pop() function is used to generate the next value in the sequence. In the VdCorput class, pop() increments the count and calculates the Van der Corput sequence value for that count and base. In the Halton class, pop() returns the next point in the Halton 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::Circle::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.