Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
Loading...
Searching...
No Matches
rng_sfmt.h
Go to the documentation of this file.
1
#ifndef RNG_SFMT_H
2
#define RNG_SFMT_H
3
4
#include "
rng_abstract.h
"
5
#include "
sfmt/SFMT.h
"
6
7
#include <QMutex>
8
#include <qtmetamacros.h>
9
#include <stdint.h>
10
11
class
QObject;
12
31
32
class
RNG_SFMT
:
public
RNG_Abstract
33
{
34
Q_OBJECT
35
private
:
36
QMutex
mutex
;
37
sfmt_t
sfmt
;
38
// The discrete cumulative distribution function for the RNG
39
unsigned
int
cdf
(
unsigned
int
min,
unsigned
int
max);
40
41
public
:
42
explicit
RNG_SFMT
(uint64_t seed, QObject *parent =
nullptr
);
43
unsigned
int
rand
(
int
min,
int
max)
override
;
44
};
45
46
#endif
SFMT.h
SIMD oriented Fast Mersenne Twister(SFMT) pseudorandom number generator using C structure.
sfmt_t
struct SFMT_T sfmt_t
Definition
SFMT.h:136
RNG_Abstract::RNG_Abstract
RNG_Abstract(QObject *parent=nullptr)
Definition
rng_abstract.h:12
RNG_SFMT::mutex
QMutex mutex
Definition
rng_sfmt.h:36
RNG_SFMT::sfmt
sfmt_t sfmt
Definition
rng_sfmt.h:37
RNG_SFMT::RNG_SFMT
RNG_SFMT(uint64_t seed, QObject *parent=nullptr)
Definition
rng_sfmt.cpp:18
RNG_SFMT::cdf
unsigned int cdf(unsigned int min, unsigned int max)
Definition
rng_sfmt.cpp:108
RNG_SFMT::rand
unsigned int rand(int min, int max) override
Definition
rng_sfmt.cpp:34
rng_abstract.h
libcockatrice_rng
libcockatrice
rng
rng_sfmt.h
Generated by
1.18.0