problems with TR1 distributions

A. Lester Buck III
Mon Aug 31 14:50:00 GMT 2009

I need to do some statistical work in C++, so I am trying to use
the TR1 extensions.  I am using g++ Debian 4.3.4-1.

To become familiar with the distributions, I found various example
code to run.  I get some of the samples to run, and others go off
into 100% cpu never to return.  (For the Debian implementation,
I have to change std::tr1:: to std::)

The following sample routines work as advertised except for
differences in expected output:

Linear Congruential
g++ output matches web page

Mersenne Twister
g++ output matches web page

Bernoulli Distribution
g++ output matches web page

Normal Distribution
g++ output DOES NOT match web page

Exponential Distribution
g++ output DOES NOT match web page

The following sample routines never return from the test program:

Poisson Distribution
never returns

Binomial Distribution
never returns

Testing C++ TR1 random number generation
never returns

Could someone tell me what might be wrong?  Is the Debian TR1 support
not working correclty?  Is the sample code invalid?  Would Boost work
better on this sample code?  Is TR1 support not ready for prime time?



More information about the Gcc-help mailing list