alternative Standard Libary  0.29.8
std::linear_congruential_engine< TIntType, a, c, m > Template-Klassenreferenz

#include <linear_congruential_engine.hpp>

Öffentliche Typen

using result_type = TIntType
 

Öffentliche Methoden

 linear_congruential_engine (result_type s=default_seed)
 
void seed (result_type s=default_seed)
 
void discard (unsigned long long z)
 
result_type last ()
 
result_type operator() ()
 

Öffentliche, statische Methoden

static constexpr result_type min ()
 
static constexpr result_type max ()
 

Statische öffentliche Attribute

static constexpr result_type multiplier = a
 
static constexpr result_type increment = c
 
static constexpr result_type modulus = m
 
static constexpr result_type default_seed = 1u
 

Ausführliche Beschreibung

template<typename TIntType, TIntType a, TIntType c, TIntType m>
class std::linear_congruential_engine< TIntType, a, c, m >

Dokumentation der benutzerdefinierten Datentypen

◆ result_type

template<typename TIntType , TIntType a, TIntType c, TIntType m>
using std::linear_congruential_engine< TIntType, a, c, m >::result_type = TIntType

Beschreibung der Konstruktoren und Destruktoren

◆ linear_congruential_engine()

template<typename TIntType , TIntType a, TIntType c, TIntType m>
std::linear_congruential_engine< TIntType, a, c, m >::linear_congruential_engine ( result_type  s = default_seed)
inlineexplicit
47  : m_iX(s % modulus) {}
static constexpr result_type modulus
Definition: linear_congruential_engine.hpp:43

Dokumentation der Elementfunktionen

◆ discard()

template<typename TIntType , TIntType a, TIntType c, TIntType m>
void std::linear_congruential_engine< TIntType, a, c, m >::discard ( unsigned long long  z)
inline
52  {
53  for (; z != 0ULL; --z)
54  (*this).operator ()();
55  }

◆ last()

template<typename TIntType , TIntType a, TIntType c, TIntType m>
result_type std::linear_congruential_engine< TIntType, a, c, m >::last ( )
inline
56  {
57  return m_iX;
58  }

◆ max()

template<typename TIntType , TIntType a, TIntType c, TIntType m>
static constexpr result_type std::linear_congruential_engine< TIntType, a, c, m >::max ( )
inlinestatic
64 { return m - 1u; }

◆ min()

template<typename TIntType , TIntType a, TIntType c, TIntType m>
static constexpr result_type std::linear_congruential_engine< TIntType, a, c, m >::min ( )
inlinestatic
63 { return c == 0u ? 1u: 0u; }

◆ operator()()

template<typename TIntType , TIntType a, TIntType c, TIntType m>
result_type std::linear_congruential_engine< TIntType, a, c, m >::operator() ( )
inline
59  {
60  m_iX = ( multiplier * m_iX + increment) % modulus;
61  return m_iX;
62  }
static constexpr result_type increment
Definition: linear_congruential_engine.hpp:42
static constexpr result_type multiplier
Definition: linear_congruential_engine.hpp:41
static constexpr result_type modulus
Definition: linear_congruential_engine.hpp:43

◆ seed()

template<typename TIntType , TIntType a, TIntType c, TIntType m>
void std::linear_congruential_engine< TIntType, a, c, m >::seed ( result_type  s = default_seed)
inline
49  {
50  m_iX = s % modulus;
51  }
static constexpr result_type modulus
Definition: linear_congruential_engine.hpp:43

Dokumentation der Datenelemente

◆ default_seed

template<typename TIntType , TIntType a, TIntType c, TIntType m>
constexpr result_type std::linear_congruential_engine< TIntType, a, c, m >::default_seed = 1u
static

◆ increment

template<typename TIntType , TIntType a, TIntType c, TIntType m>
constexpr result_type std::linear_congruential_engine< TIntType, a, c, m >::increment = c
static

◆ modulus

template<typename TIntType , TIntType a, TIntType c, TIntType m>
constexpr result_type std::linear_congruential_engine< TIntType, a, c, m >::modulus = m
static

◆ multiplier

template<typename TIntType , TIntType a, TIntType c, TIntType m>
constexpr result_type std::linear_congruential_engine< TIntType, a, c, m >::multiplier = a
static

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: