---
name: "std::tr1::xor_combine"
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::xor_combine/3cxx"
---

# std::tr1::xor\_combine(3cxx)

## NAME

std::tr1::xor\_combine -

## SYNOPSIS

### Public Types

typedef \_\_gnu\_cxx::\_\_conditional\_type\<(**sizeof**(\_Result\_type1) \> **\_Result\_type1**\
 typedef \_UniformRandomNumberGenerator1 **base1\_type**\
 typedef \_UniformRandomNumberGenerator2 **base2\_type**\
 typedef \_\_gnu\_cxx::\_\_conditional\_type\<(**sizeof**(\_Result\_type1) \> \_Result\_type2::\_\_type **result\_type**\
 typedef \_\_gnu\_cxx::\_\_conditional\_type\<(**sizeof**(\_Result\_type1) \> **sizeof** (\_Result\_type2))\

### Public Member Functions

const **base1\_type** & **base1** () const \
 const **base2\_type** & **base2** () const \
 result\_type **max** () const \
 result\_type **min** () const \
 result\_type **operator()** ()\
 template\<class \_Gen \> void **seed** (\_Gen &\_\_g)\
 void **seed** ()\
 **xor\_combine** (const **base1\_type** &\_\_rng1, const **base2\_type** &\_\_rng2)\
 **xor\_combine** (unsigned long \_\_s)\
 template\<class \_Gen \> **xor\_combine** (\_Gen &\_\_g)\

### Static Public Attributes

static const int **shift1**\
 static const int **shift2**\

### Friends

bool **operator!=** (const **xor\_combine** &\_\_lhs, const **xor\_combine** &\_\_rhs)\
 template\<class \_UniformRandomNumberGenerator11 , int \_\_s11, class \_UniformRandomNumberGenerator21 , int \_\_s21, typename \_CharT , typename \_Traits \> **std::basic\_ostream**\< \_CharT, \_Traits \> & **operator\<\<** (**std::basic\_ostream**\< \_CharT, \_Traits \> &\_\_os, const **xor\_combine**\< \_UniformRandomNumberGenerator11, \_\_s11, \_UniformRandomNumberGenerator21, \_\_s21 \> &\_\_x)\
 bool **operator==** (const **xor\_combine** &\_\_lhs, const **xor\_combine** &\_\_rhs)\
 template\<class \_UniformRandomNumberGenerator11 , int \_\_s11, class \_UniformRandomNumberGenerator21 , int \_\_s21, typename \_CharT , typename \_Traits \> **std::basic\_istream**\< \_CharT, \_Traits \> & **operator\>\>** (**std::basic\_istream**\< \_CharT, \_Traits \> &\_\_is, **xor\_combine**\< \_UniformRandomNumberGenerator11, \_\_s11, \_UniformRandomNumberGenerator21, \_\_s21 \> &\_\_x)\

## Detailed Description

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> class std::tr1::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>

A random number generator adaptor class that combines two random number generator engines into a single output sequence.

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

## Member Typedef Documentation

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> typedef \_UniformRandomNumberGenerator1 std::tr1::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>::base1\_type The type of the first underlying generator engine.

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

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> typedef \_UniformRandomNumberGenerator2 std::tr1::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>::base2\_type The type of the second underlying generator engine.

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

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> typedef \_\_gnu\_cxx::\_\_conditional\_type\<(sizeof(\_Result\_type1) \> std::tr1::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>::sizeof(\_Result\_type2)) The type of the generated random value.

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

## Member Function Documentation

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> result\_type std::tr1::xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \>::operator() ()` [inline]` Gets the next random number in the sequence.

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

## Friends And Related Function Documentation

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> bool operator!= (const xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \> & \_\_lhs, const xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \> & \_\_rhs)` [friend]` Compares two xor\_combine random number generator objects of the same type for inequality.

**Parameters:**

*\_\_lhs* A xor\_combine random number generator object. \
 *\_\_rhs* Another xor\_combine random number generator object.

**Returns:**

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

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

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> template\<class \_UniformRandomNumberGenerator11 , int \_\_s11, class \_UniformRandomNumberGenerator21 , int \_\_s21, typename \_CharT , typename \_Traits \> std::basic\_ostream\<\_CharT, \_Traits\>& operator\<\< (std::basic\_ostream\< \_CharT, \_Traits \> & \_\_os, const xor\_combine\< \_UniformRandomNumberGenerator11, \_\_s11, \_UniformRandomNumberGenerator21, \_\_s21 \> & \_\_x)` [friend]` Inserts the current state of a xor\_combine random number generator engine `__x` into the output stream `__os`.

**Parameters:**

*\_\_os* An output stream. \
 *\_\_x* A xor\_combine random number generator engine.

**Returns:**

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

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> bool operator== (const xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \> & \_\_lhs, const xor\_combine\< \_UniformRandomNumberGenerator1, \_\_s1, \_UniformRandomNumberGenerator2, \_\_s2 \> & \_\_rhs)` [friend]` Compares two xor\_combine random number generator objects of the same type for equality.

**Parameters:**

*\_\_lhs* A xor\_combine random number generator object. \
 *\_\_rhs* Another xor\_combine random number generator object.

**Returns:**

true if the two objects are equal, false otherwise.

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

### template\<class \_UniformRandomNumberGenerator1, int \_\_s1, class \_UniformRandomNumberGenerator2, int \_\_s2\> template\<class \_UniformRandomNumberGenerator11 , int \_\_s11, class \_UniformRandomNumberGenerator21 , int \_\_s21, typename \_CharT , typename \_Traits \> std::basic\_istream\<\_CharT, \_Traits\>& operator\>\> (std::basic\_istream\< \_CharT, \_Traits \> & \_\_is, xor\_combine\< \_UniformRandomNumberGenerator11, \_\_s11, \_UniformRandomNumberGenerator21, \_\_s21 \> & \_\_x)` [friend]` Extracts the current state of a xor\_combine random number generator engine `__x` from the input stream `__is`.

**Parameters:**

*\_\_is* An input stream. \
 *\_\_x* A xor\_combine 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.
