General class enabling the construction of a pattern of PRNGs by Bob Jenkins. More...
#include <Jsf.h>
Public Types | |
using | result_type = UnsignedType |
When used as a functor, this is the return type of operator () | |
Public Member Functions | |
Constructors | |
constexpr | JSF ()=default |
Default constructor. | |
constexpr | JSF (const std::array< UnsignedType, 4 > &input) |
Construct from four seed values. | |
JSF (std::seed_seq &seedSeq) | |
Construct from a seed sequence. | |
JSF (int seedInt) | |
Construct from a single integer seed value. | |
Modifiers | |
constexpr void | seed (const std::array< UnsignedType, 4 > &input) |
Seed the underlying state with four values. | |
void | seed (std::seed_seq &seedSeq) |
Seed the underlying state with a seed sequence. | |
void | seed (int seed) |
Seed the underlying state with a single integer value. | |
Operators | |
constexpr UnsignedType | operator() () |
Advance the state and return the current value. More... | |
constexpr bool | operator== (const JSF &other) const |
Compares the underlying state of two instances. More... | |
constexpr bool | operator!= (const JSF &other) const |
Compares the underlying state of two instances. | |
Static Public Member Functions | |
Public static properties | |
static constexpr result_type | min () |
Minimum value of result_type. | |
static constexpr result_type | max () |
Maximum value of result_type. | |
Private Attributes | |
State | |
UnsignedType | a_ |
UnsignedType | b_ |
UnsignedType | c_ |
UnsignedType | d_ |
Static Private Attributes | |
Static properties | |
static constexpr unsigned | bits = 8 * sizeof(UnsignedType) |
General class enabling the construction of a pattern of PRNGs by Bob Jenkins.
UnsignedType | An unsigned integer type that contains the main state of the PRNG. Choose between 32 and 64-bit state here! |
p | A parameter that influences the state advance operations. |
q | A parameter that influences the state advance operations. |
r | A parameter that influences the state advance operations. |
|
inline |
Advance the state and return the current value.
Complexity \(\Theta(1)\)
|
inline |
Compares the underlying state of two instances.
Complexity \(\Theta(1)\)