---
name: "std::variate_generator"
section: "3"
platform: "linux"
package: "libstdc++6-4.3-doc"
version: "4.3.2-1.1"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/std::variate_generator"
---

# std::variate\_generator(3)

## NAME

std::variate\_generator -

## SYNOPSIS

## 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 158 of file tr1\_impl/random.

### 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

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

## 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 182 of file tr1\_impl/random.

## Member Function Documentation

### 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 227 of file tr1\_impl/random.

### 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 220 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 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 213 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 205 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 241 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 234 of file tr1\_impl/random.

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

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

WTF?

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

### 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 189 of file tr1\_impl/random.

## Author

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