|
quint64 | generate () |
|
result_type | operator() () |
|
| QRandomGenerator64 (quint32 seedValue=1) |
|
template<qsizetype N> |
| QRandomGenerator64 (const quint32(&seedBuffer)[N]) |
|
| QRandomGenerator64 (const quint32 *seedBuffer, qsizetype len) |
|
| QRandomGenerator64 (std::seed_seq &sseq) noexcept |
|
| QRandomGenerator64 (const quint32 *begin, const quint32 *end) |
|
| QRandomGenerator64 (const QRandomGenerator &other) |
|
void | discard (unsigned long long z) |
|
quint32 | generate () |
|
template<typename ForwardIterator > |
void | generate (ForwardIterator begin, ForwardIterator end) |
|
void | generate (quint32 *begin, quint32 *end) |
|
Public Member Functions inherited from QRandomGenerator |
| QRandomGenerator (quint32 seedValue=1) |
|
template<qsizetype N> |
| QRandomGenerator (const quint32(&seedBuffer)[N]) |
|
| QRandomGenerator (const quint32 *seedBuffer, qsizetype len) |
|
Q_CORE_EXPORT | QRandomGenerator (std::seed_seq &sseq) noexcept |
|
Q_CORE_EXPORT | QRandomGenerator (const quint32 *begin, const quint32 *end) |
|
Q_CORE_EXPORT | QRandomGenerator (const QRandomGenerator &other) |
|
Q_CORE_EXPORT QRandomGenerator & | operator= (const QRandomGenerator &other) |
|
quint32 | generate () |
|
quint64 | generate64 () |
|
double | generateDouble () |
|
double | bounded (double highest) |
|
quint32 | bounded (quint32 highest) |
|
quint32 | bounded (quint32 lowest, quint32 highest) |
|
int | bounded (int highest) |
|
int | bounded (int lowest, int highest) |
|
quint64 | bounded (quint64 highest) |
|
quint64 | bounded (quint64 lowest, quint64 highest) |
|
qint64 | bounded (qint64 highest) |
|
qint64 | bounded (qint64 lowest, qint64 highest) |
|
qint64 | bounded (int lowest, qint64 highest) |
|
qint64 | bounded (qint64 lowest, int highest) |
|
quint64 | bounded (unsigned lowest, quint64 highest) |
|
quint64 | bounded (quint64 lowest, unsigned highest) |
|
template<typename UInt , IfValidUInt< UInt > = true> |
void | fillRange (UInt *buffer, qsizetype count) |
|
template<typename UInt , size_t N, IfValidUInt< UInt > = true> |
void | fillRange (UInt(&buffer)[N]) |
|
template<typename ForwardIterator > |
void | generate (ForwardIterator begin, ForwardIterator end) |
|
void | generate (quint32 *begin, quint32 *end) |
|
result_type | operator() () |
|
void | seed (quint32 s=1) |
|
void | seed (std::seed_seq &sseq) noexcept |
|
Q_CORE_EXPORT void | discard (unsigned long long z) |
|
The QRandomGenerator64 class allows one to obtain 64-bit random values from a high-quality, seed-less Random Number Generator.
\inmodule QtCore
- Since
- 5.10
QRandomGenerator64 is a simple adaptor class around QRandomGenerator, making the QRandomGenerator::generate64() function the default for operator()(), instead of the function that returns 32-bit quantities. This class is intended to be used in conjunction with Standard Library algorithms that need 64-bit quantities instead of 32-bit ones.
In all other aspects, the class is the same. Please refer to QRandomGenerator's documentation for more information.
- See also
- QRandomGenerator
Definition at line 244 of file qrandom.h.
template<typename ForwardIterator >
template< typename ForwardIterator > void QRandomGenerator::generate |
( |
typename ForwardIterator |
| ) |
|
|
inline |
Generates 32-bit quantities and stores them in the range between begin and end. This function is equivalent to (and is implemented as):
This function complies with the requirements for the function \l{http://en.cppreference.com/w/cpp/numeric/random/seed_seq/generate}{std::seed_seq::generate}
, which requires unsigned 32-bit integer values.
Note that if the [begin, end) range refers to an area that can store more than 32 bits per element, the elements will still be initialized with only 32 bits of data. Any other bits will be zero. To fill the range with 64 bit quantities, one can write:
If the range refers to contiguous memory (such as an array or the data from a QList), the fillRange() function may be used too.
- See also
- fillRange()
Definition at line 190 of file qrandom.h.