Espacios de nombres
Variantes
Acciones

std::uniform_random_bit_generator

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.
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.
 
Definido en el archivo de encabezado <random>
template <class G>

concept uniform_random_bit_generator =
  std::invocable<G&> && std::unsigned_integral<std::invoke_result_t<G&>> &&
  requires {
    { G::min() } -> std::same_as<std::invoke_result_t<G&>>;
    { G::max() } -> std::same_as<std::invoke_result_t<G&>>;
    requires std::bool_constant<(G::min() < G::max())>::value;

  };
(desde C++20)

El concepto uniform_random_bit_generator<G> especifica que G es el tipo de un generador uniforme de bits aleatorio; es decir, un objeto de tipo G es un objeto función que devuelve valores enteros sin signo tales que cada valor en el rango de los resultados posibles tiene (idealmente) una misma probabilidad de ser devuelto.

[editar] Requerimientos semánticos

uniform_random_bit_generator<G> se modela solo si, dado cualquier objeto g de tipo G:

  • g() está en el rango [G::min(), G::max()];
  • g() tiene una complejidad constante amortizada.

[editar] Notas

Para poder satisfacer el requerimiento std::bool_constant<(G::min() < G::max())>::value, tanto G::min() como G::max() deben ser expresiones constantes, y el resultado de la comparación debe ser true.