close
Espaços nominais
Variantes
Ações

Geração de números pseudo-aleatórios

De cppreference.com


 
 
Biblioteca numéricos
Funções matemáticas comuns
De ponto flutuante ambiente
Números complexos
Matrizes numéricas
Pseudo-aleatório de geração de números
Tempo de compilação aritmética racional (C++11)
Genéricos operações numéricas
Original:
Generic numeric operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
 
Pseudo-aleatório de geração de números
Motores e adaptadores de motor
Original:
Engines and engine adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Geradores
Original:
Generators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Distribuições
Original:
Distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Distribuições uniformes
Original:
Uniform distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Distribuições de Bernoulli
Original:
Bernoulli distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Distribuições de Poisson
Original:
Poisson distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Distribuições normais
Original:
Normal distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Distribuições de amostragem
Original:
Sampling distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Seqüências de sementes
Original:
Seed Sequences
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
C biblioteca
Original:
C library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 

A biblioteca de números aleatórios fornece classes que geram números aleatórios e pseudo-aleatórios. Essas classes incluem:

  • Geradores de números aleatórios (tanto geradores de números pseudo-aleatórios, que geram sequências de inteiros em uma distribuição uniforme, e geradores de números legitimamente aleatórios se estes estiverem disponíveis)
  • Distribuições de números aleatórios (ex.: uniforme, normal, distribuição de poisson) que convertem a saída gerada por um gerador de números aleatórios em várias distribuições estatísticas.

Geradores e distribuições são projetados para serem usados juntos na produção de valores aleatórios. Todos os geradores podem ser "semeados", serializados e desserializados para uso em simuladores que podem ser repetidos.

Geradores de números aleatórios

Geradores de números aleatórios geram números pseudo-aleatórios por meio de uma "semente" que funciona como fonte de entropia. Várias categorias de diferentes algoritmos de geração de números pseudo-aleatórios são implementados como gabaritos que podem ser customizados.

A escolha de qual gerador utilizar envolve uma série de compromissos: o gerador linear congruente é moderadamente rápido e utiliza pouca memória para manter o seu estado interno. O gerador de Fibonacci retardado é muito rápido mesmo em processadores sem conjuntos de instruções aritméticas avançadas, embora utilize uma quantidade maior de memória para manter seu estado interno e muitas vezes apresente características espectrais inferiores. O gerador de Mersenne Twister é o mais lento e utiliza mais memória, mas com parâmetros ideais ele gera a maior sequência de números não repetidos com as melhores características espectrais.

Defined in header <random>
implementa o algoritmo linear congruente
(modelo de classe)
implementa o algoritmo Mersenne twister
(modelo de classe)
implementa o algoritmo "subtract with carry" (do tipo Fibonacci retardado)
(modelo de classe)

Adaptadores de motor de números aleatórios

Adaptadores de motor de números aleatórios gerar números pseudo-aleatórios usando outro motor número aleatório como fonte de entropia. Eles são geralmente utilizados para alterar as características espectrais do mecanismo subjacente.
Original:
Random number engine adaptors generate pseudo-random numbers using another random number engine as entropy source. They are generally used to alter the spectral characteristics of the underlying engine.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <random>
descarta alguma saída de um motor de número aleatório
Original:
discards some output of a random number engine
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
embala a saída de um motor de número aleatório em blocos de um número específico de bits
Original:
packs the output of a random number engine into blocks of specified number of bits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
proporciona a saída de um motor de números aleatórios, de modo diferente
Original:
delivers the output of a random number engine in different order
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)

Predefinidos aleatórios geradores de números

Vários algoritmos específicos populares são predefinidos.
Original:
Several specific popular algorithms are predefined.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <random>
Tipo
Original:
Type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
minstd_rand0 std::linear_congruential_engine<uint_fast32_t, 16807, 0, 2147483647>
minstd_rand std::linear_congruential_engine<uint_fast32_t, 48271, 0, 2147483647>
mt19937 std::mersenne_twister_engine<uint_fast32_t, 32, 624, 397, 31, 0x9908b0df, 11, 0xffffffff, 7, 0x9d2c5680, 15, 0xefc60000, 18, 1812433253>
mt19937_64 std::mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9, 29, 0x5555555555555555, 17, 0x71d67fffeda60000, 37, 0xfff7eee000000000, 43, 6364136223846793005>
ranlux24_base std::subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>
ranlux48_base std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
ranlux24 std::discard_block_engine<ranlux24_base, 223, 23>
ranlux48 std::discard_block_engine<ranlux48_base, 389, 11>
knuth_b std::shuffle_order_engine<minstd_rand0, 256>
default_random_engine
Definida pela implementação
Original:
implementation-defined
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
não-determinista gerador de números aleatórios utilizando fonte de entropia hardware
Original:
non-deterministic random number generator using hardware entropy source
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(classe)

Aleatórias distribuições número

Distribuições de números aleatórios são pós-processamento da saída de um motor de números aleatórios ou adaptadores, de tal modo que a saída resultante é distribuída sobre uma função de densidade de probabilidade estatística definida.
Original:
Random number distributions are post-process the output of an random number engine or adaptors in such a way that resulting output is distributed on a defined statistical probability density function.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <random>
Distribuições uniformes
Original:
Uniform distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
produz valores inteiros uniformemente distribuídos em um intervalo
Original:
produces integer values evenly distributed across a range
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais uniformemente distribuídos em um intervalo
Original:
produces real values evenly distributed across a range
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe) [edit]
distribui valores reais de precisão dado através [0, 1)
Original:
evenly distributes real values of given precision across [0, 1)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de função) [edit]
Distribuições de Bernoulli
Original:
Bernoulli distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
produz valores bool num Distribuição de Bernoulli .
Original:
produces bool values on a Distribuição de Bernoulli.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(classe)
produz valores inteiros em um distribuição binomial .
Original:
produces integer values on a distribuição binomial.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores inteiros em um distribuição binomial negativa .
Original:
produces integer values on a distribuição binomial negativa.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores inteiros em um distribuição geométrica .
Original:
produces integer values on a distribuição geométrica.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
Distribuições de Poisson
Original:
Poisson distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
produz valores inteiros em um distribuição de Poisson .
Original:
produces integer values on a distribuição de Poisson.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais em um distribuição exponencial .
Original:
produces real values on an distribuição exponencial.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais em um distribuição gama .
Original:
produces real values on an distribuição gama.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais em uma Distribuição de Weibull .
Original:
produces real values on a Distribuição de Weibull.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais em um distribuição de valor extremo .
Original:
produces real values on an distribuição de valor extremo.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
Distribuições normais
Original:
Normal distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
produz valores reais em uma padrão de distribuição normal (Gaussiana) .
Original:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais em uma distribuição lognormal .
Original:
produces real values on a distribuição lognormal.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais em uma qui-quadrado de distribuição .
Original:
produces real values on a qui-quadrado de distribuição.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais em uma Distribuição de Cauchy .
Original:
produces real values on a Distribuição de Cauchy.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais em uma Fisher F-distribuição .
Original:
produces real values on a Fisher F-distribuição.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais em uma Student distribuição t .
Original:
produces real values on a Student distribuição t.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
Distribuições de amostragem
Original:
Sampling distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
produz inteiros aleatórios sobre uma distribuição discreta .
Original:
produces random integers on a discrete distribution.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais distribuídos em subintervalos constantes .
Original:
produces real values distributed on constant subintervals.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)
produz valores reais distribuídos em subintervalos definidos .
Original:
produces real values distributed on defined subintervals.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)

Geradores de seqüência pré-definidas de sementes

Defined in header <random>
(C++11)
de propósito geral viés eliminando mexidos gerador de seqüência de sementes
Original:
general-purpose bias-eliminating scrambled seed sequence generator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(classe)

C biblioteca

Defined in header <cstdlib>
gera um número pseudo-aleatório
Original:
generates a pseudo-random number
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
inicializa pseudo-aleatórios gerador de números
Original:
initializes pseudo-random number generator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
valor possível máxima gerada pelo std::rand
Original:
maximum possible value generated by std::rand
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(macro constante) [edit]