Boost logo

Boost :

Subject: [boost] [random] geometric_distribution backwards compatibility
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-01-23 19:40:58


AMDG

   Over the last year I've been (slowly) updating
Boost.Random to match the new standard. Unfortunately
I just hit a problem that I don't have a good solution
for. In the standard, the geometric_distribution is
defined as $p(i) = p(1-p)^{i}$, with i >= 0. In the
current Boost.Random code it is $p(i) = (1-p) p^{i-1}$,
with i >= 1. The definition in the standard makes
more sense, but I don't want to introduce a breaking
change. I can see two options here:

* Leave the implementation alone and put a big
   warning in the documentation saying that the
   behavior doesn't match the standard.
* Since I'm also moving things into namespace
   boost::random, I can use the new definition
   and leave a version with the old behavior in
   namespace boost instead of having a using
   declaration. I'd still have to add a warning
   that boost::geometric_distribution isn't the
   same as boost::random::geometric_distribution.

Neither one is particularly appealing.
Any thoughts? Better ideas?

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk