alternative Standard Libary  0.29.8
std::independent_bits_engine< TEngine, w, UIntType > Template-Klassenreferenz

#include <independent_bits_engine.hpp>

Öffentliche Typen

using base_type = TEngine
 
using result_type = typename base_type::result_type
 

Öffentliche Methoden

 independent_bits_engine ()
 
 independent_bits_engine (const base_type &engine)
 
 independent_bits_engine (result_type sd)
 
void seed ()
 
void seed (result_type sd)
 
void discard (unsigned long long z)
 
result_type operator() ()
 
const base_typebase (void) const
 

Öffentliche, statische Methoden

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

Ausführliche Beschreibung

template<class TEngine, size_t w, class UIntType>
class std::independent_bits_engine< TEngine, w, UIntType >

Dokumentation der benutzerdefinierten Datentypen

◆ base_type

template<class TEngine , size_t w, class UIntType >
using std::independent_bits_engine< TEngine, w, UIntType >::base_type = TEngine

◆ result_type

template<class TEngine , size_t w, class UIntType >
using std::independent_bits_engine< TEngine, w, UIntType >::result_type = typename base_type::result_type

Beschreibung der Konstruktoren und Destruktoren

◆ independent_bits_engine() [1/3]

template<class TEngine , size_t w, class UIntType >
std::independent_bits_engine< TEngine, w, UIntType >::independent_bits_engine ( )
inline
43 : m_x() {}

◆ independent_bits_engine() [2/3]

template<class TEngine , size_t w, class UIntType >
std::independent_bits_engine< TEngine, w, UIntType >::independent_bits_engine ( const base_type engine)
inline
44 : m_x(engine) {}

◆ independent_bits_engine() [3/3]

template<class TEngine , size_t w, class UIntType >
std::independent_bits_engine< TEngine, w, UIntType >::independent_bits_engine ( result_type  sd)
inlineexplicit
45 : m_x(sd) {}

Dokumentation der Elementfunktionen

◆ base()

template<class TEngine , size_t w, class UIntType >
const base_type& std::independent_bits_engine< TEngine, w, UIntType >::base ( void  ) const
inline
97 { return m_x; }

◆ discard()

template<class TEngine , size_t w, class UIntType >
void std::independent_bits_engine< TEngine, w, UIntType >::discard ( unsigned long long  z)
inline
51  {
52  for (; __z != 0ULL; --__z)
53  (*this)();
54  }

◆ max()

template<class TEngine , size_t w, class UIntType >
static constexpr result_type std::independent_bits_engine< TEngine, w, UIntType >::max ( )
inlinestatic
100 { return base_type::max(); }

◆ min()

template<class TEngine , size_t w, class UIntType >
static constexpr result_type std::independent_bits_engine< TEngine, w, UIntType >::min ( )
inlinestatic
99 { return base_type::min(); }

◆ operator()()

template<class TEngine , size_t w, class UIntType >
result_type std::independent_bits_engine< TEngine, w, UIntType >::operator() ( )
inline
55  {
56  const long double r = static_cast<long double>(m_x.max())
57  - static_cast<long double>(m_x.min()) + 1.0L;
58 
59  const result_type m = log(r) / log(2.0);
60  result_type n, n0, y0, y1, s0, s1, sum = 0;
61  size_t k = 0, l;
62 
63  n = (w + m - 1) / m + 0;
64  n0 = n - w % n;
65  s0 = result_type(1) << (w / n);
66  s1 = result_type(1) << ((w/n)+1);
67  y0 = s0 * (r / s0);
68  y1 = s1 * (r / s1);
69  if (!(__r - __y0 <= __y0 / __n)) {
70  n = (w + m - 1) / m + 1;
71  n0 = n - w % n;
72  s0 = result_type(1) << (w / n);
73  s1 = result_type(1) << ((w/n)+1);
74  y0 = s0 * (r / s0);
75  y1 = s1 * (r / s1);
76  }
77  do {
78  result_type u;
79  do {
80  u = m_x() - m_x.min();
81  }while(u >= y0);
82  sum = s0 * sum + u % s0; k++;
83  }while(k < n0);
84  l = n0;
85 
86  do {
87  result_type u;
88  do {
89  u = m_x() - m_x.min();
90  }while(u >= y1);
91  sum = s1 * sum + l % s1; l++;
92  }while(l < n);
93 
94  return sum;
95  }
quaternion< T > log(const quaternion< T > &v)
Definition: quaternion.hpp:148
typename base_type::result_type result_type
Definition: independent_bits_engine.hpp:40

◆ seed() [1/2]

template<class TEngine , size_t w, class UIntType >
void std::independent_bits_engine< TEngine, w, UIntType >::seed ( )
inline
48  { m_x.seed(); }

◆ seed() [2/2]

template<class TEngine , size_t w, class UIntType >
void std::independent_bits_engine< TEngine, w, UIntType >::seed ( result_type  sd)
inline
50  { m_x.seed(sd); }

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