---
name: "std::variate_generator"
section: "3cxx"
platform: "linux"
package: "libstdc++6-4.4-doc"
version: "4.4.7-2"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/std::variate_generator/3cxx"
---

# std::variate\_generator(3cxx)

## NAME

std::variate\_generator\< \_Engine, \_Dist \> -

## SYNOPSIS

### Public Types

typedef \_\_gnu\_cxx::\_\_enable\_if\
 \< **is\_arithmetic**\< result\_type \>\
 ::value, result\_type \>::\_\_type **\_IsValidType**"\
 typedef \_Dist **distribution\_type**\
 typedef \_Engine **engine\_type**\
 typedef \_\_detail::\_Adaptor\
 \< \_Engine, \_Dist \> **engine\_value\_type**"\
 typedef \_Dist::result\_type **result\_type**\

### Public Member Functions

distribution\_type & **distribution** ()\
 const distribution\_type & **distribution** () const \
 engine\_value\_type & **engine** ()\
 const engine\_value\_type & **engine** () const \
 result\_type **max** () const \
 result\_type **min** () const \
 result\_type **operator()** ()\
 template\<typename \_Tp \> result\_type **operator()** (\_Tp \_\_value)\
 **variate\_generator** (engine\_type \_\_eng, distribution\_type \_\_dist)\

## Detailed Description

### template\<typename \_Engine, typename \_Dist\>class std::variate\_generator\< \_Engine, \_Dist \>

Produces random numbers on a given distribution function using a non-uniform random number generation engine.

**Todo**

the engine\_value\_type needs to be studied more carefully.

Definition at line 218 of file tr1\_impl/random.

## Constructor & Destructor Documentation

### template\<typename \_Engine , typename \_Dist \> std::variate\_generator\< \_Engine, \_Dist \>::variate\_generator (engine\_type\_\_eng, distribution\_type\_\_dist)` [inline]`

Constructs a variate generator with the uniform random number generator `__eng` for the random distribution `__dist`.

**Exceptions:**

*Any* exceptions which may thrown by the copy constructors of the `_Engine` or `_Dist` objects.

Definition at line 242 of file tr1\_impl/random.

## Member Function Documentation

### template\<typename \_Engine , typename \_Dist \> distribution\_type& std::variate\_generator\< \_Engine, \_Dist \>::distribution ()` [inline]`

Gets a reference to the underlying random distribution.

Definition at line 280 of file tr1\_impl/random.

Referenced by std::variate\_generator\< \_Engine, \_Dist \>::max(), and std::variate\_generator\< \_Engine, \_Dist \>::min().

### template\<typename \_Engine , typename \_Dist \> const distribution\_type& std::variate\_generator\< \_Engine, \_Dist \>::distribution () const` [inline]`

Gets a const reference to the underlying random distribution.

Definition at line 287 of file tr1\_impl/random.

### template\<typename \_Engine , typename \_Dist \> engine\_value\_type& std::variate\_generator\< \_Engine, \_Dist \>::engine ()` [inline]`

Gets a reference to the underlying uniform random number generator object.

Definition at line 265 of file tr1\_impl/random.

### template\<typename \_Engine , typename \_Dist \> const engine\_value\_type& std::variate\_generator\< \_Engine, \_Dist \>::engine () const` [inline]`

Gets a const reference to the underlying uniform random number generator object.

Definition at line 273 of file tr1\_impl/random.

### template\<typename \_Engine , typename \_Dist \> result\_type std::variate\_generator\< \_Engine, \_Dist \>::max () const` [inline]`

Gets the closed upper bound of the distribution interval.

Definition at line 301 of file tr1\_impl/random.

References std::variate\_generator\< \_Engine, \_Dist \>::distribution().

### template\<typename \_Engine , typename \_Dist \> result\_type std::variate\_generator\< \_Engine, \_Dist \>::min () const` [inline]`

Gets the closed lower bound of the distribution interval.

Definition at line 294 of file tr1\_impl/random.

References std::variate\_generator\< \_Engine, \_Dist \>::distribution().

### template\<typename \_Engine , typename \_Dist \> result\_type std::variate\_generator\< \_Engine, \_Dist \>::operator() ()` [inline]`

Gets the next generated value on the distribution.

Definition at line 249 of file tr1\_impl/random.

### template\<typename \_Engine , typename \_Dist \> template\<typename \_Tp \> result\_type std::variate\_generator\< \_Engine, \_Dist \>::operator() (\_Tp\_\_value)` [inline]`

WTF?

Definition at line 257 of file tr1\_impl/random.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
