Samples the interval [ 0, 1 ] in sequence, cyclically. More...
#include <FastAndPoorGauss.h>
Public Types | |
using | Data_t = T |
Type of data required. More... | |
Public Member Functions | |
UniformSequence (unsigned int N) | |
Initializes a sequence of N steps. More... | |
void | reset () |
Restarts the sequence. More... | |
Data_t | extract () |
Returns the next number in the sequence. More... | |
Data_t | operator() () |
Private Member Functions | |
unsigned int | next () |
Returns the current point and prepares for the next one. More... | |
Private Attributes | |
unsigned int const | fN |
The number of points the interval is split into. More... | |
Data_t const | fStep |
Size of each step. More... | |
Data_t const | fOffset |
Offset of the values (half step). More... | |
unsigned int | fNext = 0U |
The next point to be delivered. More... | |
Samples the interval [ 0, 1 ] in sequence, cyclically.
T | (default: double ) type of number returned |
This object extract()
s in sequence numbers in the interval [ 0 ; 1 ]. The interval is split in equally sized bins, and each time extract()
returns the center of the next bin, starting with the first one. After reaching the last bin, it restarts the cycle.
Example of usage:
(the two sequences are identical).
Definition at line 52 of file FastAndPoorGauss.h.
using util::UniformSequence< T >::Data_t = T |
Type of data required.
Definition at line 194 of file FastAndPoorGauss.h.
|
inline |
Initializes a sequence of N steps.
Definition at line 197 of file FastAndPoorGauss.h.
|
inline |
Returns the next number in the sequence.
Definition at line 203 of file FastAndPoorGauss.h.
|
private |
Returns the current point and prepares for the next one.
Definition at line 261 of file FastAndPoorGauss.h.
|
inline |
Definition at line 204 of file FastAndPoorGauss.h.
|
inline |
Restarts the sequence.
Definition at line 208 of file FastAndPoorGauss.h.
|
private |
The number of points the interval is split into.
Definition at line 211 of file FastAndPoorGauss.h.
|
private |
The next point to be delivered.
Definition at line 216 of file FastAndPoorGauss.h.
|
private |
Offset of the values (half step).
Definition at line 214 of file FastAndPoorGauss.h.
|
private |
Size of each step.
Definition at line 213 of file FastAndPoorGauss.h.