Pseudo-random number generation
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
La biblioteca numero casuale fornisce una serie di motori generatori (entrambi pseudo-casuali, generatori di numeri interi che generano sequenze con una distribuzione uniforme, e generatore di numeri casuali se disponibile) e un insieme di classi casuali distribuzione numerica che convertono la distribuzione uniforme della motori del generatore in diverse distribuzioni statistiche.
Original:
The random number library provides a set of generator engines (both pseudo-random number generators, which generate integer sequences with a uniform distribution, and true random number generators if available) and a set of random number distribution classes which convert the uniform distribution of the generator engines into various statistical distributions.
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.
Tutti i motori del generatore possono essere specificamente seminato, serializzato, e deserializzazione per l'uso con simulatori ripetibili.
Original:
All of the generator engines may be specifically seeded, serialized, and deserialized for use with repeatable simulators.
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.
[modifica] Motori di numeri casuali
Motori di numeri casuali generare numeri pseudo-casuali utilizzando i dati di semi come fonte di entropia. Diverse classi di algoritmi di numeri pseudo-casuali generazione sono implementati come modelli che possono essere personalizzati.
Original:
Random number engines generate pseudo-random numbers using seed data as entropy source. Several different classes of pseudo-random number generation algorithms are implemented as templates that can be customized.
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.
La scelta di quale motore utilizzare comporta una serie di compromessi: il motore lineare congruenziale è moderatamente veloce e ha un requisito di memorizzazione molto piccola per stato. I generatori ritardate di Fibonacci sono molto veloce anche su processori senza set di istruzioni aritmetiche avanzate, a scapito della conservazione dello stato maggiore e caratteristiche spettrali a volte meno desiderabili. Il Mersenne Twister è più lento ed ha maggiori esigenze di storage di stato, ma con i giusti parametri la più lunga non ripetibile sequenza con le caratteristiche più desiderabili spettrali (per una definizione di desiderabile).
Original:
The choice of which engine to use involves a number of tradeoffs: the linear congruential engine is moderately fast and has a very small storage requirement for state. The lagged Fibonacci generators are very fast even on processors without advanced arithmetic instruction sets, at the expense of greater state storage and sometimes less desirable spectral characteristics. The Mersenne twister is slower and has greater state storage requirements but with the right parameters has the longest non-repeating sequence with the most desirable spectral characteristics (for a given definition of desirable).
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.
Definizione nell'header
<random> | |
(C++11) |
implementa l'algoritmo congruenziale lineare Original: implements congruenziale lineare algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
implementa l'algoritmo Mersenne twister Original: implements Mersenne twister algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
attrezzi sottrarre con trasporto (a ritardato Fibonacci) algoritmo Original: implements subtract with carry (a ritardato Fibonacci) algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
[modifica] Random Number motore adattatori
Alcuni adattatori motore numero generare numeri pseudo-casuali con un altro motore di numeri casuali come sorgente di entropia. Essi sono generalmente utilizzati per alterare le caratteristiche spettrali del motore sottostante.
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.
You can help to correct and verify the translation. Click here for instructions.
Definizione nell'header
<random> | |
(C++11) |
scarta qualche uscita di un motore di numero casuale 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. (classe template) |
(C++11) |
racchiude la potenza di un motore di numero casuale in blocchi di numero di bit specificato 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. (classe template) |
(C++11) |
fornisce l'uscita di un motore di numero casuale in ordine diverso 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. (classe template) |
[modifica] Predefiniti generatori di numeri casuali
Diversi algoritmi specifici richiesti sono predefiniti.
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.
You can help to correct and verify the translation. Click here for instructions.
Definizione nell'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, |
mt19937_64
|
std::mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9, 29, |
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
|
Implementazione definita
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. |
non deterministica generatore di numeri casuali utilizzando entropia un'origine 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) |
[modifica] Distribuzioni di numeri casuali
Distribuzioni di numeri casuali sono post-processo l'uscita di un motore di numeri casuali o schede in modo tale che l'uscita risultante viene distribuita su una funzione di densità di probabilità statistica definita.
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.
You can help to correct and verify the translation. Click here for instructions.
Definizione nell'header
<random> | |
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. | |
(C++11) |
produce valori interi uniformemente distribuiti in una vasta gamma 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. (classe template) |
(C++11) |
produce valori reali uniformemente distribuiti in una vasta gamma 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. (classe template) |
(C++11) |
distribuisce in modo uniforme i valori reali di precisione dato in [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. (funzione di modello) |
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. | |
(C++11) |
produce valori bool su un Bernoulli distribuzione . Original: produces bool values on a Bernoulli distribuzione. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(C++11) |
produce valori interi su una distribuzione binomiale . Original: produces integer values on a distribuzione binomiale. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
produce valori interi su una distribuzione binomiale negativa . Original: produces integer values on a distribuzione binomiale negativa. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) | |
(C++11) |
produce valori interi su una distribuzione geometrica . Original: produces integer values on a distribuzione geometrica. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
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. | |
(C++11) |
produce valori interi su una poisson distribuzione . Original: produces integer values on a poisson distribuzione. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
produce valori reali su un distribuzione esponenziale . Original: produces real values on an distribuzione esponenziale. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
produce valori reali su un distribuzione gamma . Original: produces real values on an distribuzione gamma. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
produce valori reali su una Distribuzione di Weibull . Original: produces real values on a Distribuzione di Weibull. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
produce valori reali su un valore di distribuzione estremo . Original: produces real values on an valore di distribuzione estremo. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
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. | |
(C++11) |
produce valori reali su una standard normale (gaussiana) di distribuzione . Original: produces real values on a standard normale (gaussiana) di distribuzione. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
produce valori reali su una distribuzione lognormale . Original: produces real values on a distribuzione lognormale. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
produce valori reali su una distribuzione chi-quadro . Original: produces real values on a distribuzione chi-quadro. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
produce valori reali su una Cauchy distribuzione . Original: produces real values on a Cauchy distribuzione. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
produce valori reali su una Fisher F-distribuzione . Original: produces real values on a Fisher F-distribuzione. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
(C++11) |
produce valori reali su una T di Student distribuzione . Original: produces real values on a T di Student distribuzione. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe template) |
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. | |
(C++11) |
produce interi casuali su una distribuzione 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. (classe template) |
produce valori reali distribuiti su sotto-intervalli costanti . 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. (classe template) | |
produce valori reali distribuiti su sottointervalli definiti . 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. (classe template) |
[modifica] Predefiniti seme sequenza generatori
Definizione nell'header
<random> | |
(C++11) |
general-purpose diagonale eliminando strapazzate generatore di sequenza di semi 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) |
[modifica] Libreria C
Definizione nell'header
<cstdlib> | |
genera un numero pseudo-casuale 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. (funzione) | |
inizializza pseudo-generatore di numeri casuali 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. (funzione) | |
massimo valore possibile generato da 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 costante) |