|
LdsGen 1.2.6
|
Van der Corput sequence generator. More...
#include <ilds.hpp>
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) | |
Van der Corput sequence generator.
Implementation based on pre-calculating the scale factor.
|
inlineexplicit |
Construct a new VdCorput object.
| [in] | base | The base of the number system (default: 2) |
| [in] | scale | The number of digits (default: 10) |
|
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.
| [in] | n | The sequence index. |