/*
* Implementation-space details.
*/
- namespace
+ namespace __detail
{
template<typename _UIntType, int __w,
bool = __w < std::numeric_limits<_UIntType>::digits>
typedef __gnu_cxx::__conditional_type<(sizeof(unsigned) == 4),
unsigned, unsigned long>::__type _UInt32Type;
- } // anonymous namespace
/*
* An adaptor class for converting the output of any Generator into
/ result_type(_M_g.max() - _M_g.min());
return __return_value;
}
-
+ } // namespace __detail
/**
* Produces random numbers on a given disribution function using a un uniform
public:
typedef _Engine engine_type;
- typedef _Adaptor<_Engine, _Dist> engine_value_type;
+ typedef __detail::_Adaptor<_Engine, _Dist> engine_value_type;
typedef _Dist distribution_type;
typedef typename _Dist::result_type result_type;
typedef typename __gnu_cxx::__enable_if<
is_arithmetic<result_type>::value, result_type>::__type _IsValidType;
- public:
/**
* Constructs a variate generator with the uniform random number
* generator @p __eng for the random distribution @p __dist.
*/
result_type
min() const
- { return (__mod<_UIntType, 1, 0, __m>(__c) == 0) ? 1 : 0; }
+ { return (__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0) ? 1 : 0; }
/**
* Gets the largest possible value in the output range.
void
seed(_Gen& __g, false_type);
- private:
_UIntType _M_x;
};
result_type
max() const
- { return _Shift<_UIntType, __w>::__value - 1; }
+ { return __detail::_Shift<_UIntType, __w>::__value - 1; }
result_type
operator()();
void
seed(_Gen& __g, false_type);
- private:
_UIntType _M_x[state_size];
int _M_p;
};
static const int long_lag = __r;
static const int short_lag = __s;
- public:
/**
* Constructs a default-initialized % subtract_with_carry random number
* generator.
void
seed(_Gen& __g, false_type);
- private:
typedef typename __gnu_cxx::__add_unsigned<_IntType>::__type _UIntType;
_UIntType _M_x[long_lag];
static const int long_lag = __r;
static const int short_lag = __s;
- public:
/**
* Constructs a default-initialized % subtract_with_carry_01 random
* number generator.
void
seed(_Gen& __g, false_type);
- private:
void
_M_initialize_npows();
static const int __n = (__w + 31) / 32;
+ typedef __detail::_UInt32Type _UInt32Type;
_UInt32Type _M_x[long_lag][__n];
_RealType _M_npows[__n];
_UInt32Type _M_carry;