std::seed_seq
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <random>
|
||
class seed_seq; |
(dal C++11) | |
std::seed_seq consuma una sequenza di valori interi dati e produce un numero richiesto di valori interi senza segno i, 0 ≤ i < 232, sulla base dei dati consumati. I valori prodotti sono distribuiti sull'intera gamma 32-bit, anche se i valori sono vicini consumati.
Original:
std::seed_seq consumes a sequence of integer-valued data and produces a requested number of unsigned integer values i, 0 ≤ i < 232, based on the consumed data. The produced values are distributed over the entire 32-bit range even if the consumed values are close.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Esso fornisce un modo per seme un gran numero di motori di numeri casuali o un generatore di seme che richiede molta entropia, dato un piccolo seme o una sequenza mal distribuita seme iniziale.
Original:
It provides a way to seed a large number of random number engines or to seed a generator that requires a lot of entropy, given a small seed or a poorly distributed initial seed sequence.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
std::seed_seq soddisfi i requisiti di SeedSequence.Original:
std::seed_seq meets the requirements of SeedSequence.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Membri tipi
Membro tipo
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
result_type
|
std::uint_least32_t |
Membri funzioni
costrutti e semi il std :: seed_seq oggetto Original: constructs and seeds the std::seed_seq object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |
operator= (cancellato) |
non copia-assegnabile Original: not copy-assignable The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |
calcola i polarizzazione-eliminati, uniformemente distribuiti valori a 32 bit Original: calculates the bias-eliminated, evenly distributed 32-bit values The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |
ottiene il numero di valori a 32 bit memorizzati in std :: seed_seq Original: obtains the number of 32-bit values stored in std::seed_seq The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |
ottiene i valori a 32 bit memorizzati in std :: seed_seq Original: obtains the 32-bit values stored in std::seed_seq The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) | |
Esempio
#include <random>
#include <iostream>
int main()
{
std::seed_seq seq({1,2,3,4,5});
std::vector<std::uint32_t> seeds(10);
seq.generate(seeds.begin(), seeds.end());
for(std::uint32_t n : seeds)
std::cout << n << '\n';
}
Output:
4204997637
4246533866
1856049002
1129615051
690460811
1075771511
46783058
3904109078
1534123438
1495905678