re PR libstdc++/39835 (Bootstrap failure: libstdc++-v3/include/bits/random.h:3630: error: expected â,â or â...â before numeric constant)
2009-04-21 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/39835 * include/bits/random.h: Avoid the badname __alpha (and, for consistency, __beta too). * include/bits/random.tcc: Likewise. From-SVN: r146516
This commit is contained in:
parent
2970ccb3bb
commit
ed2807f4cd
|
@ -1,3 +1,10 @@
|
|||
2009-04-21 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR libstdc++/39835
|
||||
* include/bits/random.h: Avoid the badname __alpha (and, for
|
||||
consistency, __beta too).
|
||||
* include/bits/random.tcc: Likewise.
|
||||
|
||||
2009-04-19 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* include/c_compatibility/stdatomic.h (__atomic_flag_for_address): Use
|
||||
|
|
|
@ -3627,9 +3627,9 @@ namespace std
|
|||
friend class gamma_distribution<_RealType>;
|
||||
|
||||
explicit
|
||||
param_type(_RealType __alpha = _RealType(1),
|
||||
_RealType __beta = _RealType(1))
|
||||
: _M_alpha(__alpha), _M_beta(__beta)
|
||||
param_type(_RealType __alpha_val = _RealType(1),
|
||||
_RealType __beta_val = _RealType(1))
|
||||
: _M_alpha(__alpha_val), _M_beta(__beta_val)
|
||||
{
|
||||
_GLIBCXX_DEBUG_ASSERT(_M_alpha > _RealType(0));
|
||||
_M_initialize();
|
||||
|
@ -3660,9 +3660,9 @@ namespace std
|
|||
* @f$ \alpha @f$ and @f$ \beta @f$.
|
||||
*/
|
||||
explicit
|
||||
gamma_distribution(_RealType __alpha = _RealType(1),
|
||||
_RealType __beta = _RealType(1))
|
||||
: _M_param(__alpha, __beta)
|
||||
gamma_distribution(_RealType __alpha_val = _RealType(1),
|
||||
_RealType __beta_val = _RealType(1))
|
||||
: _M_param(__alpha_val, __beta_val)
|
||||
{ }
|
||||
|
||||
explicit
|
||||
|
|
|
@ -1921,14 +1921,14 @@ namespace std
|
|||
__aurng(__urng);
|
||||
|
||||
bool __reject;
|
||||
const _RealType __alpha = __param.alpha();
|
||||
const _RealType __beta = __param.beta();
|
||||
if (__alpha >= 1)
|
||||
const _RealType __alpha_val = __param.alpha();
|
||||
const _RealType __beta_val = __param.beta();
|
||||
if (__alpha_val >= 1)
|
||||
{
|
||||
// alpha - log(4)
|
||||
const result_type __b = __alpha
|
||||
const result_type __b = __alpha_val
|
||||
- result_type(1.3862943611198906188344642429163531L);
|
||||
const result_type __c = __alpha + __param._M_l_d;
|
||||
const result_type __c = __alpha_val + __param._M_l_d;
|
||||
const result_type __1l = 1 / __param._M_l_d;
|
||||
|
||||
// 1 + log(9 / 2)
|
||||
|
@ -1936,11 +1936,11 @@ namespace std
|
|||
|
||||
do
|
||||
{
|
||||
const result_type __u = __aurng() / __beta;
|
||||
const result_type __v = __aurng() / __beta;
|
||||
const result_type __u = __aurng() / __beta_val;
|
||||
const result_type __v = __aurng() / __beta_val;
|
||||
|
||||
const result_type __y = __1l * std::log(__v / (1 - __v));
|
||||
__x = __alpha * std::exp(__y);
|
||||
__x = __alpha_val * std::exp(__y);
|
||||
|
||||
const result_type __z = __u * __v * __v;
|
||||
const result_type __r = __b + __c * __y - __x;
|
||||
|
@ -1953,12 +1953,12 @@ namespace std
|
|||
}
|
||||
else
|
||||
{
|
||||
const result_type __c = 1 / __alpha;
|
||||
const result_type __c = 1 / __alpha_val;
|
||||
|
||||
do
|
||||
{
|
||||
const result_type __z = -std::log(__aurng() / __beta);
|
||||
const result_type __e = -std::log(__aurng() / __beta);
|
||||
const result_type __z = -std::log(__aurng() / __beta_val);
|
||||
const result_type __e = -std::log(__aurng() / __beta_val);
|
||||
|
||||
__x = std::pow(__z, __c);
|
||||
|
||||
|
@ -1967,7 +1967,7 @@ namespace std
|
|||
while (__reject);
|
||||
}
|
||||
|
||||
return __beta * __x;
|
||||
return __beta_val * __x;
|
||||
}
|
||||
|
||||
template<typename _RealType, typename _CharT, typename _Traits>
|
||||
|
@ -2005,10 +2005,10 @@ namespace std
|
|||
const typename __ios_base::fmtflags __flags = __is.flags();
|
||||
__is.flags(__ios_base::dec | __ios_base::skipws);
|
||||
|
||||
_RealType __alpha, __beta;
|
||||
__is >> __alpha >> __beta;
|
||||
_RealType __alpha_val, __beta_val;
|
||||
__is >> __alpha_val >> __beta_val;
|
||||
__x.param(typename gamma_distribution<_RealType>::
|
||||
param_type(__alpha, __beta));
|
||||
param_type(__alpha_val, __beta_val));
|
||||
|
||||
__is.flags(__flags);
|
||||
return __is;
|
||||
|
|
Loading…
Reference in New Issue