mirror of
https://github.com/boostorg/random.git
synced 2026-02-26 17:02:15 +00:00
Merge random from the trunk
[SVN r74867]
This commit is contained in:
@@ -124,7 +124,7 @@ public:
|
||||
RealType p() const { return _p; }
|
||||
|
||||
/** Returns the smallest value that the distribution can produce. */
|
||||
IntType min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return IntType(1); }
|
||||
IntType min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return IntType(0); }
|
||||
|
||||
/** Returns the largest value that the distribution can produce. */
|
||||
IntType max BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||
|
||||
@@ -159,7 +159,7 @@ public:
|
||||
|
||||
// fix up the state if it's all zeroes.
|
||||
if((x[0] & (~static_cast<UIntType>(0) << r)) == 0) {
|
||||
for(std::size_t j = 1; i < n; ++j) {
|
||||
for(std::size_t j = 1; j < n; ++j) {
|
||||
if(x[j] != 0) return;
|
||||
}
|
||||
x[0] = static_cast<UIntType>(1) << (w-1);
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
|
||||
// fix up the state if it's all zeroes.
|
||||
if((x[0] & (~static_cast<UIntType>(0) << r)) == 0) {
|
||||
for(std::size_t j = 1; i < n; ++j) {
|
||||
for(std::size_t j = 1; j < n; ++j) {
|
||||
if(x[j] != 0) return;
|
||||
}
|
||||
x[0] = static_cast<UIntType>(1) << (w-1);
|
||||
|
||||
@@ -98,8 +98,8 @@ public:
|
||||
r3 = r3 ^ (r3 >> 27);
|
||||
r3 = (r3 * 1566083941u) & mask;
|
||||
value_type r4 = r3 - k%m;
|
||||
*(first + (k+p)%n) ^= r4;
|
||||
*(first + (k+q)%n) ^= r3;
|
||||
*(first + (k+p)%n) ^= r3;
|
||||
*(first + (k+q)%n) ^= r4;
|
||||
*(first + k%n) = r4;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user