LdsGen 1.2.6
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ldsgen::Sphere Class Reference

Sphere sequence generator. More...

#include <lds.hpp>

Inheritance diagram for ldsgen::Sphere:
[legend]
Collaboration diagram for ldsgen::Sphere:
[legend]

Public Member Functions

 Sphere (const unsigned long base0, const unsigned long base1)
 Construct a new Sphere object.
 
auto value_at (unsigned long n) const -> std::array< double, 3 >
 Evaluate the point on the unit sphere at a given index (pure, no state change)
 
- Public Member Functions inherited from ldsgen::GeneratorIterable< Sphere, std::array< double, 3 > >
auto begin () -> GeneratorIterator< Sphere, std::array< double, 3 > >
 Get iterator to beginning.
 
auto end () const -> GeneratorIterator< Sphere, std::array< double, 3 > >
 Get iterator to end (infinite sequence)
 
- Public Member Functions inherited from ldsgen::GeneratorBase< Derived, Value >
auto pop () -> Value
 Generate the next value in the sequence (advances state).
 
auto peek () -> Value
 Peek at the next value without advancing state.
 
auto skip (unsigned int n) -> void
 Skip n values in the sequence.
 
auto reseed (const unsigned long &seed) -> void
 Reset the generator to a specific seed value.
 
auto get_index () const -> unsigned long
 Get current index in the sequence.
 

Additional Inherited Members

- Protected Attributes inherited from ldsgen::GeneratorBase< Derived, Value >
std::atomic< unsigned long > count_ {0}
 Current sequence index (single source of state)
 

Detailed Description

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.

*     Unit Sphere:
*          *****
*       **       **
*     **           **
*    *               *
*    *      O        *  Points distributed
*    *               *  evenly on surface
*     **           **
*       **       **
*          *****
* 

Constructor & Destructor Documentation

◆ Sphere()

ldsgen::Sphere::Sphere ( const unsigned long  base0,
const unsigned long  base1 
)
inline

Construct a new Sphere object.

Constructs a Sphere sequence generator with the specified bases for generating points on the unit sphere.

Parameters
[in]base0the base for the Van der Corput generator (phi coordinate)
[in]base1the base for the Circle generator (theta coordinate)

Member Function Documentation

◆ value_at()

auto ldsgen::Sphere::value_at ( unsigned long  n) const -> std::array<double, 3>
inline

Evaluate the point on the unit sphere at a given index (pure, no state change)

\( \phi = 2\pi \cdot \phi_{b_1}(n), \quad \cos\theta = 2\phi_{b_0}(n) - 1 \) \( P(n) = \bigl(\sin\theta\cos\phi,\; \sin\theta\sin\phi,\; \cos\theta\bigr) \)

Parameters
[in]nThe sequence index.
Returns
The point on the unit sphere for index n.

The documentation for this class was generated from the following file: