GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing cplusplus.com — <random> Reference
<random>
header
<random>Random
This library allows to produce random numbers using combinations of generators and distributions:
Distribution objects generate random numbers by means of their operator() member, which takes a generator object as argument:
For repeated uses, both can be bound together:
Except for random_device, all standard generators defined in the library are random number engines, which are a kind of generators that use a particular algorithm to generate series of pseudo-random numbers. These algorithms need a seed as a source of randomness, and this seed can either be a single value or an object with a very specific generate() member function (see seed_seq for more info). A typical source of randomness for trivial tasks is time, such as the information provided by time or system_clock::now (for a typical example, see uniform_int_distribution::operator()). As an alternative, trivial random numbers can also be generated using cstdlib's functions rand and srand. GeneratorsPseudo-random number engines (templates)Generators that use an algorithm to generate pseudo-random numbers based on an initial seed:
Engine adaptorsThey adapt an engine, modifying the way numbers are generated with it:
Pseudo-random number engines (instantiations)Particular instantiations of generator engines and adaptors:
Random number generatorsNon-deterministic random number generator:
DistributionsUniform:
Related to Bernoulli (yes/no) trials:
Rate-based distributions:
Related to Normal distribution:
Piecewise distributions:
Other
Home page | Privacy policy
© cplusplus.com, 2000-2026 - All rights reserved - v3.3.4s Spotted an error? contact us | ||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |