This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.

791. piecewise_constant_distribution::densities has wrong name

Section: 29.5.9.6.2 [rand.dist.samp.pconst] Status: NAD Submitter: P.J. Plauger Opened: 2008-02-09 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [rand.dist.samp.pconst].

View all issues with NAD status.

Discussion:

piecewise_constant_distribution::densities() should be probabilities(), just like discrete_distribution. (There's no real use for weights divided by areas.)

[ Bellevue: ]

Fermilab does not agree with this summary. As defined in the equation in 26.4.8.5.2/4, the quantities are indeed probability densities not probabilities. Because we view this distribution as a parameterization of a *probability density function*, we prefer to work in terms of probability densities.

We don't think this should be changed.

If there is a technical argument about why the implementation dealing with these values can't be as efficient as one dealing with probabilities, we might reconsider. We don't care about this one member function being somewhat more or less efficient; we care about the size of the distribution object and the speed of the calls to generate variates.

Proposed resolution:

Change synopsis in 29.5.9.6.2 [rand.dist.samp.pconst]:

template <class RealType = double> 
class piecewise_constant_distribution 
{ 
public:
    ...
    vector<double> densities probabilities() const;
    ...
};

Change 29.5.9.6.2 [rand.dist.samp.pconst]/6:

vector<double> densities probabilities() const;