std::seed_seq
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Definido no cabeçalho <random>
|
||
class seed_seq; |
(desde C++11) | |
std::seed_seq consome uma sequência de número inteiro com valores de dados e produz um número requerido de valores inteiros sem sinal i, 0 ≤ i < 232, com base nos dados consumidos. Os valores produzidos são distribuídos ao longo da gama de 32-bit inteiro, mesmo que os valores são consumidos perto.
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.
Ele fornece um modo de sementes de um grande número de mecanismos de números aleatórios ou de sementes de um gerador, que requer uma grande quantidade de entropia, dada uma pequena semente ou de uma sequência de sementes mal distribuída inicial.
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 cumpre os requisitos da 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.
Tipos de membro
Tipo de membro
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 |
Funções de membro
construções e sementes o std :: objeto seed_seq 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. (função pública membro) | |
operator= (excluída) |
cópia não-transmissíveis 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. (função pública membro) |
calcula o viés-eliminados, distribuídos uniformemente valores de 32 bits 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. (função pública membro) | |
obtém o número de valores de 32 bits armazenados em 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. (função pública membro) | |
obtém os valores de 32 bits armazenados em 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. (função pública membro) | |
Exemplo
#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';
}
Saída:
4204997637
4246533866
1856049002
1129615051
690460811
1075771511
46783058
3904109078
1534123438
1495905678