Boost logo

Boost Users :

From: dahaverk_at_[hidden]
Date: 2006-03-09 10:03:03


Hello,

I am trying to convert from boost_1_29_0 to boost_1_33_1 with the random
functions. I am using GCC 2.95.3 on Solaris 8.

with the Older version of boost_1_29_0 We used the following:

             exp_(rnd_, 1.0/lambda_), // Initialization list Class
constructor.

   And then used it as follows...
             lastArrival_ += exp_() * 1000.0; // rnd_.seed already
initialized

For boost_1_33_1 We changed this to be:

            exp_(1.0/lambda_),

     Then used it as follows:

             lastArrival_ += exp_(rnd_) * 1000.0;

Declarations used:
      // exponential distribution to determine
      // arrival time
      double lambda_;
      boost::exponential_distribution<> exp_;
      boost::poisson_distribution<> poisson_;

However, with the older 1_29 version of boost we were getting numbers
such as 3.xxxxxx, 0.xxxxxxx and so on when I printed "exp_()" out. With
the new boost_1_33_1 all I see printed out is "Infinite" for the value ot
the "exp_(rnd_)"

I'm new to boost so any help would be appreciated. This was someone
else's code, and I am supposed to plug in the poisson_distribution, but I'd
like it to work with the exponential_distribution as it did previously. I
assume that I'm either not doing the Initialization correctly or didn't
understand what the "Engine" was supposed to be to convert from the
previous version. Any tips on using the boost poisson_distribution would
be appreciated also. I am assuming Poisson will be initialized with
"poisson_(lambda_)" and used as "lastArrival_ += poisson_(exp_) * 1000.0; "

Thanks for any help.

David Haverkamp


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net