Halton class
#include <ldsgen/lds.hpp>
Halton sequence generator.
The Halton class is a sequence generator that generates points in a 2-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 Halton 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::array<double, 2>.
* Halton(2,3) sequence: * pop() -> (0.5, 0.333) (VdC(2) -> 0.5, VdC(3) -> 0.333) * pop() -> (0.25, 0.666) (VdC(2) -> 0.25, VdC(3) -> 0.666) * pop() -> (0.75, 0.111) (VdC(2) -> 0.75, VdC(3) -> 0.111) * ... *
Constructors, destructors, conversion operators
Public functions
- auto pop() -> std::array< double, 2 > -> auto
- Generate the next point in the Halton sequence.
- auto peek() -> std::array< double, 2 > -> auto
- Peek at the next value without advancing state.
- auto skip(unsigned int n) -> void -> auto
- Skip n values in the sequence.
- auto reseed(const unsigned long& seed) -> void -> auto
- Reset the state of the Halton sequence generator.
- auto get_index() const -> unsigned long -> auto
- Get current index.
- auto begin() -> GeneratorIterator< Halton, std::array< double, 2 > > -> auto
- Get iterator to beginning.
- auto end() const -> GeneratorIterator< Halton, std::array< double, 2 > > -> auto
- Get iterator to end (infinite sequence)
Function documentation
auto ldsgen:: Halton:: peek() -> std::array< double, 2 >
Peek at the next value without advancing state.
| Returns | std::array<double, 2> the next point in the sequence |
|---|
auto ldsgen:: Halton:: skip(unsigned int n) -> void
Skip n values in the sequence.
| Parameters | |
|---|---|
| n in | number of values to skip |
auto ldsgen:: Halton:: get_index() const -> unsigned long
Get current index.
| Returns | unsigned long current index in the sequence |
|---|
auto ldsgen:: Halton:: begin() -> GeneratorIterator< Halton, std::array< double, 2 > >
Get iterator to beginning.
| Returns | GeneratorIterator<Halton, std::array<double, 2>> |
|---|
auto ldsgen:: Halton:: end() const -> GeneratorIterator< Halton, std::array< double, 2 > >
Get iterator to end (infinite sequence)
| Returns | GeneratorIterator<Halton, std::array<double, 2>> |
|---|