43 #include <QtCore/qalgorithms.h>
59 template <
typename UInt>
using IfValidUInt =
81 return !(rng1 == rng2);
86 return quint32(_fillRange(
nullptr, 1));
104 x >>= std::numeric_limits<quint64>::digits - std::numeric_limits<double>::digits;
105 return double(
x) / double(
limit);
124 return bounded(highest - lowest) + lowest;
135 return bounded(highest - lowest) + lowest;
143 return bounded(highest - lowest) + lowest;
154 return bounded(highest - lowest) + lowest;
176 template <
typename UInt, IfVal
idUInt<UInt> = true>
182 template <
typename UInt,
size_t N, IfVal
idUInt<UInt> = true>
189 template <
typename ForwardIterator>
205 Q_CORE_EXPORT
void discard(
unsigned long long z);
206 static constexpr
result_type min() {
return (std::numeric_limits<result_type>::min)(); }
207 static constexpr
result_type max() {
return (std::numeric_limits<result_type>::max)(); }
220 struct InitialRandomData {
227 using RandomEngine =
std::mersenne_twister_engine<
quint32,
228 32,624,397,31,0x9908b0df,11,0xffffffff,7,0x9d2c5680,15,0xefc60000,18,1812433253>;
232 RandomEngine twister;
233 RandomEngine &engine() {
return twister; }
234 const RandomEngine &engine()
const {
return twister; }
237 "std::mersenne_twister not trivially destructible as expected");
276 "Overflow. Are you sure you want to skip over 9 quintillion samples?");
280 static constexpr
result_type min() {
return (std::numeric_limits<result_type>::min)(); }
281 static constexpr
result_type max() {
return (std::numeric_limits<result_type>::max)(); }
302 }
while (
v >= highest);
The QRandomGenerator64 class allows one to obtain 64-bit random values from a high-quality,...
void discard(unsigned long long z)
static Q_CORE_EXPORT QRandomGenerator64 securelySeeded()
static Q_DECL_CONST_FUNCTION Q_CORE_EXPORT QRandomGenerator64 * global()
static constexpr result_type min()
QRandomGenerator64(std::seed_seq &sseq) noexcept
QRandomGenerator64(const QRandomGenerator &other)
QRandomGenerator64(quint32 seedValue=1)
QRandomGenerator64(const quint32 *begin, const quint32 *end)
QRandomGenerator64(const quint32 *seedBuffer, qsizetype len)
static constexpr result_type max()
QRandomGenerator64(const quint32(&seedBuffer)[N])
static Q_DECL_CONST_FUNCTION Q_CORE_EXPORT QRandomGenerator64 * system()
The QRandomGenerator class allows one to obtain random values from a high-quality Random Number Gener...
friend InitialRandomData qt_initial_random_value() noexcept
friend class QRandomGenerator64
static Q_DECL_CONST_FUNCTION QRandomGenerator * system()
void fillRange(UInt(&buffer)[N])
Q_CORE_EXPORT QRandomGenerator & operator=(const QRandomGenerator &other)
qint64 bounded(qint64 highest)
quint64 bounded(quint64 lowest, unsigned highest)
Q_CORE_EXPORT void discard(unsigned long long z)
QRandomGenerator(quint32 seedValue=1)
void generate(quint32 *begin, quint32 *end)
QRandomGenerator(const quint32 *seedBuffer, qsizetype len)
static Q_DECL_CONST_FUNCTION QRandomGenerator * global()
static constexpr result_type max()
qint64 bounded(int lowest, qint64 highest)
double bounded(double highest)
quint64 bounded(quint64 lowest, quint64 highest)
friend Q_CORE_EXPORT bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
void generate(ForwardIterator begin, ForwardIterator end)
quint32 bounded(quint32 lowest, quint32 highest)
void seed(std::seed_seq &sseq) noexcept
static constexpr result_type min()
qint64 bounded(qint64 lowest, qint64 highest)
quint32 bounded(quint32 highest)
friend bool operator!=(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
QRandomGenerator(const quint32(&seedBuffer)[N])
quint64 bounded(unsigned lowest, quint64 highest)
static QRandomGenerator securelySeeded()
qint64 bounded(qint64 lowest, int highest)
int bounded(int lowest, int highest)
void fillRange(UInt *buffer, qsizetype count)
auto generate(StringRef generatorName, SourceLineInfo const &lineInfo, L const &generatorExpression) -> decltype(std::declval< decltype(generatorExpression())>().get())
QT_POPCOUNT_RELAXED_CONSTEXPR uint qCountLeadingZeroBits(quint32 v) noexcept
#define Q_DECL_CONST_FUNCTION
EGLOutputLayerEXT EGLint EGLAttrib value
unsigned long long quint64
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
#define Q_ASSERT_X(cond, x, msg)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
std::seed_seq sseq(seedBuffer, seedBuffer+len)
[3]
QThreadStorage< int * > dummy[8]