---
name: "std::tr1::discard_block"
section: "3cxx"
platform: "linux"
package: "libstdc++6-4.4-doc"
version: "4.4.5-8"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/std::tr1::discard_block/3cxx"
---

# std::tr1::discard\_block(3cxx)

## NAME

std::tr1::discard\_block -

## SYNOPSIS

### Public Types

typedef \_UniformRandomNumberGenerator **base\_type**\
 typedef base\_type::result\_type **result\_type**\

### Public Member Functions

const **base\_type** & **base** () const \
 **discard\_block** (const **base\_type** &\_\_rng)\
 template\<class \_Gen \> **discard\_block** (\_Gen &\_\_g)\
 **discard\_block** ()\
 **discard\_block** (unsigned long \_\_s)\
 **result\_type** **max** () const \
 **result\_type** **min** () const \
 **result\_type** **operator()** ()\
 void **seed** ()\
 template\<class \_Gen \> void **seed** (\_Gen &\_\_g)\

### Static Public Attributes

static const int **block\_size**\
 static const int **used\_block**\

### Friends

bool **operator!=** (const **discard\_block** &\_\_lhs, const **discard\_block** &\_\_rhs)\
 template\<class \_UniformRandomNumberGenerator1 , int \_\_p1, int \_\_r1, typename \_CharT , typename \_Traits \> **std::basic\_ostream**\< \_CharT, \_Traits \> & **operator\<\<** (**std::basic\_ostream**\< \_CharT, \_Traits \> &\_\_os, const **discard\_block**\< \_UniformRandomNumberGenerator1, \_\_p1, \_\_r1 \> &\_\_x)\
 bool **operator==** (const **discard\_block** &\_\_lhs, const **discard\_block** &\_\_rhs)\
 template\<class \_UniformRandomNumberGenerator1 , int \_\_p1, int \_\_r1, typename \_CharT , typename \_Traits \> **std::basic\_istream**\< \_CharT, \_Traits \> & **operator\>\>** (**std::basic\_istream**\< \_CharT, \_Traits \> &\_\_is, **discard\_block**\< \_UniformRandomNumberGenerator1, \_\_p1, \_\_r1 \> &\_\_x)\

## Detailed Description

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> class std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>

Produces random numbers from some base engine by discarding blocks of data.

0 \<= `__r` \<= `__p`

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

## Member Typedef Documentation

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> typedef \_UniformRandomNumberGenerator std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::base\_type The type of the underlying generator engine.

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

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> typedef base\_type::result\_type std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::result\_type The type of the generated random value.

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

## Constructor & Destructor Documentation

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::discard\_block ()` [inline]` Constructs a default discard\_block engine.

The underlying engine is default constructed as well.

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

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::discard\_block (const base\_type & \_\_rng)` [inline, explicit]` Copy constructs a discard\_block engine.

Copies an existing base class random number generator.

**Parameters:**

*rng* An existing (base class) engine object.

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

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::discard\_block (unsigned long \_\_s)` [inline, explicit]` Seed constructs a discard\_block engine.

Constructs the underlying generator engine seeded with `__s`.

**Parameters:**

*\_\_s* A seed value for the base class engine.

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

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> template\<class \_Gen \> std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::discard\_block (\_Gen & \_\_g)` [inline]` Generator construct a discard\_block engine.

**Parameters:**

*\_\_g* A seed generator function.

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

## Member Function Documentation

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> const base\_type& std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::base () const` [inline]` Gets a const reference to the underlying generator engine object.

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

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> result\_type std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::max () const` [inline]` Gets the maximum value in the generated random number range.

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

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> result\_type std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::min () const` [inline]` Gets the minimum value in the generated random number range.

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

### template\<class \_UniformRandomNumberGenerator , int \_\_p, int \_\_r\> discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::result\_type std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::operator() () Gets the next value in the generated random number sequence.

Definition at line 583 of file random.tcc.

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> template\<class \_Gen \> void std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::seed (\_Gen & \_\_g)` [inline]` Reseeds the discard\_block object with the given seed generator function.

**Parameters:**

*\_\_g* A seed generator function.

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

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> void std::tr1::discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \>::seed ()` [inline]` Reseeds the discard\_block object with the default seed for the underlying base class generator engine.

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

## Friends And Related Function Documentation

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> bool operator!= (const discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \> & \_\_lhs, const discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \> & \_\_rhs)` [friend]` Compares two discard\_block random number generator objects of the same type for inequality.

**Parameters:**

*\_\_lhs* A discard\_block random number generator object. \
 *\_\_rhs* Another discard\_block random number generator object.

**Returns:**

true if the two objects are not equal, false otherwise.

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

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> template\<class \_UniformRandomNumberGenerator1 , int \_\_p1, int \_\_r1, typename \_CharT , typename \_Traits \> std::basic\_ostream\<\_CharT, \_Traits\>& operator\<\< (std::basic\_ostream\< \_CharT, \_Traits \> & \_\_os, const discard\_block\< \_UniformRandomNumberGenerator1, \_\_p1, \_\_r1 \> & \_\_x)` [friend]` Inserts the current state of a discard\_block random number generator engine `__x` into the output stream `__os`.

**Parameters:**

*\_\_os* An output stream. \
 *\_\_x* A discard\_block random number generator engine.

**Returns:**

The output stream with the state of `__x` inserted or in an error state.

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> bool operator== (const discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \> & \_\_lhs, const discard\_block\< \_UniformRandomNumberGenerator, \_\_p, \_\_r \> & \_\_rhs)` [friend]` Compares two discard\_block random number generator objects of the same type for equality.

**Parameters:**

*\_\_lhs* A discard\_block random number generator object. \
 *\_\_rhs* Another discard\_block random number generator object.

**Returns:**

true if the two objects are equal, false otherwise.

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

### template\<class \_UniformRandomNumberGenerator, int \_\_p, int \_\_r\> template\<class \_UniformRandomNumberGenerator1 , int \_\_p1, int \_\_r1, typename \_CharT , typename \_Traits \> std::basic\_istream\<\_CharT, \_Traits\>& operator\>\> (std::basic\_istream\< \_CharT, \_Traits \> & \_\_is, discard\_block\< \_UniformRandomNumberGenerator1, \_\_p1, \_\_r1 \> & \_\_x)` [friend]` Extracts the current state of a % subtract\_with\_carry random number generator engine `__x` from the input stream `__is`.

**Parameters:**

*\_\_is* An input stream. \
 *\_\_x* A discard\_block random number generator engine.

**Returns:**

The input stream with the state of `__x` extracted or in an error state.

## Author

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