alternative Standard Libary  0.29.8
std::isaac_engine< TIntType, size, TGoldenRatio > Template-Klassenreferenz

#include <isaac_engine.hpp>

Öffentliche Typen

using result_type = TIntType
 

Öffentliche Methoden

 isaac_engine (result_type a=0, result_type b=0, result_type c=0)
 
void seed (result_type a, result_type b, result_type c, result_type s=((void *) 0))
 
void discard (unsigned long long z)
 
result_type operator() ()
 

Öffentliche, statische Methoden

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

Statische öffentliche Attribute

static constexpr result_type golden_ratio = result_type(TGoldenRatio)
 

Ausführliche Beschreibung

template<class TIntType, size_t size, TIntType TGoldenRatio>
class std::isaac_engine< TIntType, size, TGoldenRatio >

Dokumentation der benutzerdefinierten Datentypen

◆ result_type

template<class TIntType , size_t size, TIntType TGoldenRatio>
using std::isaac_engine< TIntType, size, TGoldenRatio >::result_type = TIntType

Beschreibung der Konstruktoren und Destruktoren

◆ isaac_engine()

template<class TIntType , size_t size, TIntType TGoldenRatio>
std::isaac_engine< TIntType, size, TGoldenRatio >::isaac_engine ( result_type  a = 0,
result_type  b = 0,
result_type  c = 0 
)
inline
43  {
44  seed(a,b,c);
45  }
void seed(result_type a, result_type b, result_type c, result_type s=((void *) 0))
Definition: isaac_engine.hpp:46

Dokumentation der Elementfunktionen

◆ discard()

template<class TIntType , size_t size, TIntType TGoldenRatio>
void std::isaac_engine< TIntType, size, TGoldenRatio >::discard ( unsigned long long  z)
inline
85  {
86  for (; z != 0ULL; --z)
87  (*this).operator ()();
88  }

◆ max()

template<class TIntType , size_t size, TIntType TGoldenRatio>
static constexpr result_type std::isaac_engine< TIntType, size, TGoldenRatio >::max ( )
inlinestatic
94 { return (size == 64) ? UINT64_MAX : UINT32_MAX; }

◆ min()

template<class TIntType , size_t size, TIntType TGoldenRatio>
static constexpr result_type std::isaac_engine< TIntType, size, TGoldenRatio >::min ( )
inlinestatic
93 { return 0; }

◆ operator()()

template<class TIntType , size_t size, TIntType TGoldenRatio>
result_type std::isaac_engine< TIntType, size, TGoldenRatio >::operator() ( )
inline
89  {
90  return(!m_cnt-- ? (isaac(), m_cnt=(255), m_rsl[m_cnt]) :
91  m_rsl[m_cnt]);
92  }

◆ seed()

template<class TIntType , size_t size, TIntType TGoldenRatio>
void std::isaac_engine< TIntType, size, TGoldenRatio >::seed ( result_type  a,
result_type  b,
result_type  c,
result_type  s = ((void*)0) 
)
inline
46  {
47  result_type a,b,c,d,e,f,g,h;
48  a = b = c = d = e = f = g = h = golden_ratio;
49 
50  for(int i = 0; i < 256; i++) {
51  m_rsl[i] = s != ((void*)0) ? s[i] : 0;
52  }
53  m_a = a;
54  m_b = b;
55  m_c = c;
56 
57  shuffle(a,b,c,d,e,f,g,h);
58  shuffle(a,b,c,d,e,f,g,h);
59  shuffle(a,b,c,d,e,f,g,h);
60  shuffle(a,b,c,d,e,f,g,h);
61 
62 
63  for(result_type i=0; i < 256; i+=8) {
64  a+= (m_rsl)[i ]; b+=(m_rsl)[i+1]; c+=(m_rsl)[i+2]; d+=(m_rsl)[i+3];
65  e+= (m_rsl)[i+4]; f+=(m_rsl)[i+5]; g+=(m_rsl)[i+6]; h+=(m_rsl)[i+7];
66 
67  shuffle(a,b,c,d,e,f,g,h);
68 
69  (m_mem)[i ]=a; (m_mem)[i+1]=b; (m_mem)[i+2]=c; (m_mem)[i+3]=d;
70  (m_mem)[i+4]=e; (m_mem)[i+5]=f; (m_mem)[i+6]=g; (m_mem)[i+7]=h;
71 
72  }
73  for(result_type i=0; i < 256; i += 8) {
74  a+=(m_mem)[i ]; b+=(m_mem)[i+1]; c+=(m_mem)[i+2]; d+=(m_mem)[i+3];
75  e+=(m_mem)[i+4]; f+=(m_mem)[i+5]; g+=(m_mem)[i+6]; h+=(m_mem)[i+7];
76 
77  shuffle(a,b,c,d,e,f,g,h);
78 
79  (m_mem)[i ]=a; (m_mem)[i+1]=b; (m_mem)[i+2]=c; (m_mem)[i+3]=d;
80  (m_mem)[i+4]=e; (m_mem)[i+5]=f; (m_mem)[i+6]=g; (m_mem)[i+7]=h;
81  }
82  isaac();
83  m_cnt = 255;
84  }
TIntType result_type
Definition: isaac_engine.hpp:40
static constexpr result_type golden_ratio
Definition: isaac_engine.hpp:41

Dokumentation der Datenelemente

◆ golden_ratio

template<class TIntType , size_t size, TIntType TGoldenRatio>
constexpr result_type std::isaac_engine< TIntType, size, TGoldenRatio >::golden_ratio = result_type(TGoldenRatio)
static

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