Espaços nominais
Variantes
Acções

std::uniform_int_distribution

Da cppreference.com
< cpp‎ | numeric‎ | random
Revisão das 16h57min de 2 de novembro de 2012 por P12bot (discussão | contribs)

 
 
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.
uniform_int_distribution
(C++11)
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.
 
std::uniform_int_distribution
Funções de membro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uniform_int_distribution::uniform_int_distribution
uniform_int_distribution::reset
Geração
Original:
Generation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uniform_int_distribution::operator()
Características
Original:
Characteristics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uniform_int_distribution::a
uniform_int_distribution::b
uniform_int_distribution::param
uniform_int_distribution::min
uniform_int_distribution::max
Não-membros funções
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Definido no cabeçalho <random>
template< class IntType = int >
class uniform_int_distribution;
(desde C++11)
Produz aleatória i valores inteiros, distribuídos uniformemente no intervalo [a, b] fechado, isto é, distribuídas de acordo com a função de probabilidade discreta
Original:
Produces random integer values i, uniformly distributed on the closed interval [a, b], that is, distributed according to the discrete probability function
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
P(i|a,b) =
1
b − a + 1
.

Índice

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 IntType
param_type
o tipo do conjunto de parâmetros, não especificado
Original:
the type of the parameter set, unspecified
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Funções de membro

Predefinição:cpp/numeric/random/distribution/dcl list constructorPredefinição:cpp/numeric/random/distribution/dcl list resetPredefinição:cpp/numeric/random/distribution/dcl list operator()Predefinição:cpp/numeric/random/uniform int distribution/dcl list aPredefinição:cpp/numeric/random/uniform int distribution/dcl list bPredefinição:cpp/numeric/random/distribution/dcl list paramPredefinição:cpp/numeric/random/distribution/dcl list minPredefinição:cpp/numeric/random/distribution/dcl list max
Geração
Original:
Generation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Características
Original:
Characteristics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Não-membros funções

Predefinição:cpp/numeric/random/distribution/dcl list operator cmpPredefinição:cpp/numeric/random/distribution/dcl list operator ltltgtgt

Exemplo

Este programa simula jogando seis lados dados .
Original:
This program simulates throwing 6-sided dice.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <random>
#include <iostream>
int main()
{
    std::random_device rd;
    std::mt19937 gen(rd());
    std::uniform_int_distribution<> dis(1, 6);
    for(int n=0; n<10; ++n)
        std::cout << dis(gen) << ' ';
    std::cout << '\n';
}

Potencial saída:

1 1 6 5 2 2 5 5 6 2