std::subtract_with_carry< _IntType, __m, __s, __r > Class Template Reference
[Random Number Generators]

List of all members.

Detailed Description

template<typename _IntType, _IntType __m, int __s, int __r>
class std::subtract_with_carry< _IntType, __m, __s, __r >

Definition at line 655 of file tr1_impl/random.

Public Types

Public Member Functions

Static Public Attributes

Friends


Member Typedef Documentation

template<typename _IntType, _IntType __m, int __s, int __r>
typedef _IntType std::subtract_with_carry< _IntType, __m, __s, __r >::result_type

The type of the generated random value.

Definition at line 661 of file tr1_impl/random.


Constructor & Destructor Documentation

template<typename _IntType, _IntType __m, int __s, int __r>
std::subtract_with_carry< _IntType, __m, __s, __r >::subtract_with_carry (  )  [inline]

Constructs a default-initialized % subtract_with_carry random number generator.

Definition at line 672 of file tr1_impl/random.

References std::subtract_with_carry< _IntType, __m, __s, __r >::seed().

template<typename _IntType, _IntType __m, int __s, int __r>
std::subtract_with_carry< _IntType, __m, __s, __r >::subtract_with_carry ( unsigned long  __value  )  [inline, explicit]

Constructs an explicitly seeded % subtract_with_carry random number generator.

Definition at line 680 of file tr1_impl/random.

References std::subtract_with_carry< _IntType, __m, __s, __r >::seed().

template<typename _IntType, _IntType __m, int __s, int __r>
template<class _Gen>
std::subtract_with_carry< _IntType, __m, __s, __r >::subtract_with_carry ( _Gen &  __g  )  [inline]

Constructs a subtract_with_carry random number generator engine seeded from the generator function __g.

Parameters:
__g The seed generator function.

Definition at line 690 of file tr1_impl/random.

References std::subtract_with_carry< _IntType, __m, __s, __r >::seed().


Member Function Documentation

template<typename _IntType, _IntType __m, int __s, int __r>
result_type std::subtract_with_carry< _IntType, __m, __s, __r >::max (  )  const [inline]

Gets the inclusive maximum value of the range of random integers returned by this generator.

Definition at line 729 of file tr1_impl/random.

template<typename _IntType, _IntType __m, int __s, int __r>
result_type std::subtract_with_carry< _IntType, __m, __s, __r >::min (  )  const [inline]

Gets the inclusive minimum value of the range of random integers returned by this generator.

Definition at line 721 of file tr1_impl/random.

template<typename _IntType, _IntType __m, int __s, int __r>
subtract_with_carry< _IntType, __m, __s, __r >::result_type std::subtract_with_carry< _IntType, __m, __s, __r >::operator() (  ) 

Gets the next random number in the sequence.

Definition at line 363 of file random.tcc.

References std::subtract_with_carry< _IntType, __m, __s, __r >::short_lag.

template<typename _IntType, _IntType __m, int __s, int __r>
template<class _Gen>
void std::subtract_with_carry< _IntType, __m, __s, __r >::seed ( _Gen &  __g  )  [inline]

Seeds the initial state $ x_0 $ of the % subtract_with_carry random number generator.

Definition at line 713 of file tr1_impl/random.

References std::subtract_with_carry< _IntType, __m, __s, __r >::seed().

template<typename _IntType, _IntType __m, int __s, int __r>
void std::subtract_with_carry< _IntType, __m, __s, __r >::seed ( unsigned long  __value = 19780503  ) 

Seeds the initial state $ x_0 $ of the random number generator.

N1688[4.19] modifies this as follows. If __value == 0, sets value to 19780503. In any case, with a linear congruential generator lcg(i) having parameters $ m_{lcg} = 2147483563, a_{lcg} = 40014, c_{lcg} = 0, and lcg(0) = value $, sets $ x_{-r} \dots x_{-1} $ to $ lcg(1) \bmod m \dots lcg(r) \bmod m $ respectively. If $ x_{-1} = 0 $ set carry to 1, otherwise sets carry to 0.

Definition at line 321 of file random.tcc.

References _GLIBCXX_TR1, and std::subtract_with_carry< _IntType, __m, __s, __r >::long_lag.

Referenced by std::subtract_with_carry< _IntType, __m, __s, __r >::seed(), and std::subtract_with_carry< _IntType, __m, __s, __r >::subtract_with_carry().


Friends And Related Function Documentation

template<typename _IntType, _IntType __m, int __s, int __r>
bool operator!= ( const subtract_with_carry< _IntType, __m, __s, __r > &  __lhs,
const subtract_with_carry< _IntType, __m, __s, __r > &  __rhs 
) [friend]

Compares two % subtract_with_carry random number generator objects of the same type for inequality.

Parameters:
__lhs A % subtract_with_carry random number generator object.
__rhs Another % subtract_with_carry random number generator object.
Returns:
true if the two objects are not equal, false otherwise.

Definition at line 764 of file tr1_impl/random.

template<typename _IntType, _IntType __m, int __s, int __r>
template<typename _IntType1, _IntType1 __m1, int __s1, int __r1, typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>& operator<< ( std::basic_ostream< _CharT, _Traits > &  __os,
const subtract_with_carry< _IntType1, __m1, __s1, __r1 > &  __x 
) [friend]

Inserts the current state of a % subtract_with_carry random number generator engine __x into the output stream __os.

Parameters:
__os An output stream.
__x A % subtract_with_carry random number generator engine.
Returns:
The output stream with the state of __x inserted or in an error state.

template<typename _IntType, _IntType __m, int __s, int __r>
bool operator== ( const subtract_with_carry< _IntType, __m, __s, __r > &  __lhs,
const subtract_with_carry< _IntType, __m, __s, __r > &  __rhs 
) [friend]

Compares two % subtract_with_carry random number generator objects of the same type for equality.

Parameters:
__lhs A % subtract_with_carry random number generator object.
__rhs Another % subtract_with_carry random number generator object.
Returns:
true if the two objects are equal, false otherwise.

Definition at line 749 of file tr1_impl/random.

template<typename _IntType, _IntType __m, int __s, int __r>
template<typename _IntType1, _IntType1 __m1, int __s1, int __r1, typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>& operator>> ( std::basic_istream< _CharT, _Traits > &  __is,
subtract_with_carry< _IntType1, __m1, __s1, __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 % subtract_with_carry random number generator engine.
Returns:
The input stream with the state of __x extracted or in an error state.


The documentation for this class was generated from the following files:
Generated on Wed Mar 26 00:44:51 2008 for libstdc++ by  doxygen 1.5.1