Espacios de nombres
Variantes
Acciones

std::uniform_real_distribution

De cppreference.com
< cpp‎ | numeric‎ | random
 
 
 
Generación de números pseudoaleatorios
Motores y 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.
Generadores
Original:
Generators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Distribuciones
Original:
Distributions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Distribuciones 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_real_distribution
(C++11)
Bernoulli distribuciones
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.
Poisson distribuciones
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.
Distribuciones normales
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.
Distribuciones de muestreo
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.
Secuencias de semillas
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_real_distribution
Las funciones miembro
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.
Generación
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.
Terceros funciones
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 en el archivo de encabezado <random>
template<class RealType =double>
class uniform_real_distribution;
(desde C++11)
Produce aleatorio de punto flotante i valores, distribuida uniformemente en el intervalo de [a, b), es decir, distribuidos de acuerdo con la función de probabilidad:
Original:
Produces random floating-point values i, uniformly distributed on the interval [a, b), that is, distributed according to the 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
.

Contenido

[editar]Tipos de miembros

Miembro de 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_typeRealType
param_type
el tipo del conjunto de parámetros, sin especificar
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.

[editar]Las funciones miembro

construye nueva distribución
Original:
constructs new distribution
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública)[editar]
restablece el estado interno de la distribución
Original:
resets the internal state of the distribution
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública)[editar]
Generación
Original:
Generation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
genera el siguiente número aleatorio en la distribución
(función miembro pública)[editar]
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.
devuelve el a parámetro de distribución (valor mínimo)
Original:
returns the a distribution parameter (minimum value)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública)[editar]
devuelve el b parámetro de distribución (valor máximo)
Original:
returns the b distribution parameter (maximum value)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública)[editar]
obtiene o establece el objeto de parámetro de distribución
Original:
gets or sets the distribution parameter object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública)[editar]
devuelve el valor mínimo potencialmente generado
Original:
returns the minimum potentially generated value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública)[editar]
devuelve el valor máximo potencialmente generado
Original:
returns the maximum potentially generated value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública)[editar]

[editar]Terceros funciones

compara dos objetos de distribución
(función)[editar]
realiza flujo de entrada y salida en la distribución de números pseudo-aleatorios
(función)[editar]

[editar]Ejemplo

imprimir 10 números aleatorios entre 1 y 2
Original:
print 10 random numbers between 1 and 2
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_real_distribution<> dis(1, 2);for(int n =0; n <10;++n){std::cout<< dis(gen)<<' ';}std::cout<<'\n';}

Salida:

1.80829 1.15391 1.18483 1.38969 1.36094 1.0648 1.97798 1.27984 1.68261 1.57326
close