ldsgen::HaltonN class

Halton(n) sequence generator.

The HaltonN class is a sequence generator that generates points in a N-dimensional space using the Halton sequence. The Halton sequence is a low-discrepancy sequence that is commonly used in quasi-Monte Carlo methods. It is generated by iterating over two different bases and calculating the fractional parts of the numbers in those bases. The HaltonN class keeps track of the current count and bases, and provides a pop() method that returns the next point in the sequence as a std::vector<double>.

*     HaltonN([2,3,5]) sequence (3D):
*     pop() -> [0.5, 0.333, 0.2]    (VdC bases [2,3,5])
*     pop() -> [0.25, 0.666, 0.4]   (next in each sequence)
*     pop() -> [0.75, 0.111, 0.6]   (etc...)
*     ...
* 

Constructors, destructors, conversion operators

HaltonN(const vector<unsigned long>& base) explicit
Construct a new Halton N object.

Public functions

auto pop() -> vector< double > -> auto
Generate the next point in the N-dimensional Halton sequence.
auto reseed(unsigned long seed) -> void -> auto
Reset the state of the HaltonN sequence generator.

Function documentation

ldsgen::HaltonN::HaltonN(const vector<unsigned long>& base) explicit

Construct a new Halton N object.

Parameters
base in vector of unsigned long values representing the bases for each dimension

Constructs an N-dimensional Halton sequence generator with the specified bases.

auto ldsgen::HaltonN::pop() -> vector< double >

Generate the next point in the N-dimensional Halton sequence.

Returns vector<double> the next point in the sequence

Returns the next point in the N-dimensional Halton sequence as a vector of double values.

auto ldsgen::HaltonN::reseed(unsigned long seed) -> void

Reset the state of the HaltonN sequence generator.

Parameters
seed in the seed value to reset the sequence generator to

Resets the state of the sequence generator to a specific seed value.