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

Van der Corput sequence generator. More...

#include <ilds.hpp>

Inheritance diagram for ildsgen::VdCorput:
[legend]
Collaboration diagram for ildsgen::VdCorput:
[legend]

Public Member Functions

 VdCorput (unsigned long base=2, unsigned int scale=DEFAULT_SCALE)
 Construct a new VdCorput object.
 
auto value_at (unsigned long n) const -> unsigned long
 Evaluate the integer sequence value at a given index (pure, no state change)
 
- Public Member Functions inherited from ldsgen::GeneratorBase< VdCorput, unsigned long >
auto pop () -> unsigned long
 Generate the next value in the sequence (advances state).
 
auto peek () -> unsigned long
 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< VdCorput, unsigned long >
std::atomic< unsigned long > count_
 Current sequence index (single source of state)
 

Detailed Description

Van der Corput sequence generator.

Implementation based on pre-calculating the scale factor.

Constructor & Destructor Documentation

◆ VdCorput()

ildsgen::VdCorput::VdCorput ( unsigned long  base = 2,
unsigned int  scale = DEFAULT_SCALE 
)
inlineexplicit

Construct a new VdCorput object.

Parameters
[in]baseThe base of the number system (default: 2)
[in]scaleThe number of digits (default: 10)

Member Function Documentation

◆ value_at()

auto ildsgen::VdCorput::value_at ( unsigned long  n) const -> unsigned long
inline

Evaluate the integer sequence value at a given index (pure, no state change)

\[ \phi_b^{\mathbb{Z}}(n) = \sum_{k=0}^{\infty} a_k(n) \cdot \mathrm{factor}_k \]

where \(\mathrm{factor}_k = b^{\mathrm{scale}-1-k}\) scales the reversed base-b digits into an integer.

Parameters
[in]nThe sequence index.
Returns
The integer Van der Corput value for index n.

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