|
Boost : |
Subject: Re: [boost] [random] geometric_distribution backwards compatibility
From: sguazt (marco.guazzone_at_[hidden])
Date: 2011-01-24 01:59:00
On Mon, Jan 24, 2011 at 1:40 AM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> 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.
>
I vote for this one.
It's like to have a new major version of Random.... And as most of the
new major versions of a library it has not necessarily to be backward
compatible (e.g., Boost.Signals vs Boost.Signals2 just to remain in
the Boost family).
Best,
-- Marco
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk