Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Scine::Molassembler::Temple::JSF< UnsignedType, p, q, r > Class Template Reference

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)
 

Private member functions

static constexpr UnsignedType rotate_ (UnsignedType x, unsigned k)
 
constexpr void advance_ ()
 
constexpr void advance_ (unsigned N)
 
constexpr void seed_ (const std::array< UnsignedType, 4 > &state)
 
void seed_ (std::seed_seq &seedSeq)
 

Detailed Description

template<typename UnsignedType, unsigned p, unsigned q, unsigned r>
class Scine::Molassembler::Temple::JSF< UnsignedType, p, q, r >

General class enabling the construction of a pattern of PRNGs by Bob Jenkins.

Template Parameters
UnsignedTypeAn unsigned integer type that contains the main state of the PRNG. Choose between 32 and 64-bit state here!
pA parameter that influences the state advance operations.
qA parameter that influences the state advance operations.
rA parameter that influences the state advance operations.

Member Function Documentation

template<typename UnsignedType , unsigned p, unsigned q, unsigned r>
constexpr UnsignedType Scine::Molassembler::Temple::JSF< UnsignedType, p, q, r >::operator() ( )
inline

Advance the state and return the current value.

Complexity \(\Theta(1)\)

template<typename UnsignedType , unsigned p, unsigned q, unsigned r>
constexpr bool Scine::Molassembler::Temple::JSF< UnsignedType, p, q, r >::operator== ( const JSF< UnsignedType, p, q, r > &  other) const
inline

Compares the underlying state of two instances.

Complexity \(\Theta(1)\)


The documentation for this class was generated from the following file: