ldsgen::Sphere3Hopf class

S(3) sequence generator by Hopf fibration.

The Sphere3Hopf class is a sequence generator that generates points on a 3-sphere using the Hopf fibration. It uses three instances of the VdCorput class to generate the sequence values and maps them to points on the 3-sphere. The pop() method returns the next point on the 3-sphere as a std::array<double, 4>, where the first three elements represent the x, y, and z coordinates of the point, and the fourth element represents the w coordinate. The reseed() method is used to reset the state of the sequence generator to a specific seed value.

Public functions

auto Sphere3Hopf(const size_t base0, const size_t base1, const size_t base2) -> CONSTEXPR14
Construct a new Sphere 3 Hopf object.
auto pop() -> std::array< double, 4 > -> auto
pop
auto reseed(size_t seed) -> void -> CONSTEXPR14 auto
reseed

Function documentation

CONSTEXPR14 ldsgen::Sphere3Hopf::Sphere3Hopf(const size_t base0, const size_t base1, const size_t base2)

Construct a new Sphere 3 Hopf object.

Parameters
base0 in
base1 in
base2 in

auto ldsgen::Sphere3Hopf::pop() -> std::array< double, 4 >

pop

Returns std::array<double, 4>

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