class
#include <ldsgen/lds.hpp>
Sphere Sphere sequence generator.
The Sphere
class is a sequence generator that generates points on a unit sphere using the Van der Corput sequence. It uses the VdCorput
class to generate the sequence values and maps them to points on the unit sphere. The pop()
method returns the next point on the unit sphere as a std::array<double, 3>
, where the first element represents the x-coordinate, the second element represents the y-coordinate of the point, and the third element represents the z-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 Sphere(const size_t base0, const size_t base1) -> CONSTEXPR14
- Construct a new Sphere object.
- auto pop() -> std::array< double, 3 > -> auto
- pop
- auto reseed(size_t seed) -> void -> CONSTEXPR14 auto
- reseed
Function documentation
CONSTEXPR14 ldsgen:: Sphere:: Sphere(const size_t base0,
const size_t base1)
Construct a new Sphere object.
Parameters | |
---|---|
base0 in | |
base1 in |
auto ldsgen:: Sphere:: pop() -> std::array< double, 3 >
pop
Returns | std::array<double, 3> |
---|
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:: Sphere:: reseed(size_t seed) -> void
reseed
Parameters | |
---|---|
seed in |
The reseed(size_
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.