// random number generation (out of line) -*- C++ -*-
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
/** @file tr1/random.tcc
* This is an internal header file, included by other library headers.
- * You should not attempt to use it directly.
+ * Do not attempt to use it directly. @headername{tr1/random}
*/
-namespace std
+#ifndef _GLIBCXX_TR1_RANDOM_TCC
+#define _GLIBCXX_TR1_RANDOM_TCC 1
+
+namespace std _GLIBCXX_VISIBILITY(default)
{
namespace tr1
{
*/
namespace __detail
{
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
// General case for x = (ax + c) mod m -- use Schrage's algorithm to avoid
// integer overflow.
//
__calc(_Tp __x)
{ return __a * __x + __c; }
};
+ _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
const _UIntType
* is defined.
*
* Reference:
- * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag,
* New York, 1986, Ch. X, Sects. 3.3 & 3.4 (+ Errata!).
*/
template<typename _IntType, typename _RealType>
* is defined.
*
* Reference:
- * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag,
* New York, 1986, Ch. X, Sect. 4 (+ Errata!).
*/
template<typename _IntType, typename _RealType>
/**
* Polar method due to Marsaglia.
*
- * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag,
* New York, 1986, Ch. V, Sect. 4.4.
*/
template<typename _RealType>
* alpha < 1.
*
* References:
- * Cheng, R. C. "The Generation of Gamma Random Variables with Non-integral
- * Shape Parameter." Applied Statistics, 26, 71-75, 1977.
+ * Cheng, R. C. The Generation of Gamma Random Variables with Non-integral
+ * Shape Parameter. Applied Statistics, 26, 71-75, 1977.
*
- * Vaduva, I. "Computer Generation of Gamma Gandom Variables by Rejection
- * and Composition Procedures." Math. Operationsforschung and Statistik,
+ * Vaduva, I. Computer Generation of Gamma Gandom Variables by Rejection
+ * and Composition Procedures. Math. Operationsforschung and Statistik,
* Series in Statistics, 8, 545-576, 1977.
*
- * Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
+ * Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag,
* New York, 1986, Ch. IX, Sect. 3.4 (+ Errata!).
*/
template<typename _RealType>
__os.precision(__precision);
return __os;
}
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
}
+
+#endif