Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10364: Release 1.56 broke random::uniform_real_distribution
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-02-16 03:03:15
#10364: Release 1.56 broke random::uniform_real_distribution
-------------------------------+---------------------------
Reporter: mouse008@⦠| Owner: no-maintainer
Type: Bugs | Status: new
Milestone: To Be Determined | Component: random
Version: Boost 1.56.0 | Severity: Regression
Resolution: | Keywords:
-------------------------------+---------------------------
Comment (by Mouse <mouse008@â¦>):
Further checking shows that `uniform_real_distribution<> uc(-20.0, 20.0);`
works (compiles and runs fine). `uniform_real_distribution<mpf_float_50>
ur(-20.0, 20.0);` fails to compile (see attached output of compile
attempt: `b-r6b.out`).
This compiles and runs OK:
{{{
#include <iostream>
#include <boost/multiprecision/gmp.hpp>
#include <boost/multiprecision/random.hpp>
using namespace boost::multiprecision;
using namespace boost::random;
int main() {
unsigned long long myseed = 0x12345670;
mt19937 rgen(myseed);
uniform_real_distribution<> uc(-20.0, 20.0);
std::cout << std::hex
// << std::showbase
;
//
// Generate some values:
//
std::cout << std::setprecision(50);
for(unsigned i = 0; i < 20; ++i)
std::cout << std::setw(2) << (i+1) << ": "
<< std::setw(20)
<< uc(rgen)
<< std::endl;
std::cout << std::endl;
}
}}}
giving this output:
{{{
$ ./b-r6a
1: 17.07083447836339473724365234375
2: 18.59527722932398319244384765625
3: 17.2086485661566257476806640625
4: -7.10314041934907436370849609375
5: 12.02050872147083282470703125
6: 16.396274752914905548095703125
7: 18.85700456798076629638671875
8: 0.078481473028659820556640625
9: 4.03215981088578701019287109375
a: 3.56800344772636890411376953125
b: 4.79332183487713336944580078125
c: 0.429534278810024261474609375
d: 13.35449189879000186920166015625
e: -6.27208642661571502685546875
f: 13.10226154513657093048095703125
10: -8.06778541766107082366943359375
11: 6.47328031249344348907470703125
12: -9.097188748419284820556640625
13: 16.7489224486052989959716796875
14: 18.96312631666660308837890625
}}}
This does not compile (see the attached output):
{{{
#include <iostream>
#include <boost/multiprecision/gmp.hpp>
#include <boost/multiprecision/random.hpp>
using namespace boost::multiprecision;
using namespace boost::random;
int main() {
unsigned long long myseed = 0x12345670;
mt19937 rgen(myseed);
independent_bits_engine<mt19937, 100, mpf_float_50> gen3(rgen);
uniform_real_distribution<mpf_float_50> ur(-20.0, 20.0);
std::cout << std::hex
// << std::showbase
;
//
// Generate some values:
//
std::cout << std::setprecision(50);
for(unsigned i = 0; i < 20; ++i)
std::cout << std::setw(2) << (i+1) << ": "
<< std::setw(20)
<< ur(gen3) << " "
<< ur(rgen)
<< std::endl;
std::cout << std::endl;
}
}}}
Unfortunately I cannot test the proposed commit because I'm not building
Boost myself (any more). I have to wait until the fix percolates down to
the distributions, and Macports picks it up. :-(
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10364#comment:4> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC