commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (MATH-1158) Factory method to provide sampling from distributions
Date Thu, 23 Oct 2014 10:45:34 GMT


Gilles commented on MATH-1158:


bq. it would be consequent to also deprecate all the constructors of all RealDistribution
implementations that accept a RandomGenerator instance.

That would be the subsequent action, if all agree on the proposed way forward.

bq. Why not separating the sampling functionality for IntegerDistribution too?

Of course, similar modifications would be in order.


bq. I would prefer to keep the API stable.

We all do _prefer_, but if something is slightly broken...

In practice, thanks to the changing of the top-level package's name, we never force users
to upgrade their code anymore, do we?
The old API (3.3) will be stable forever...

\[On the other hand, if users decide to upgrade, they should not force _us_ to not improve
the library whenever such an opportunity arises.\]

bq. \[...\] we decided to add sampling to the distributions.

And I stand by that decision. \[Sampling requires access to the distribution's internal data,
so the implementation cannot be separate if we want to avoid code duplication.\]
The idea is not to go back to the previous design (with code duplication), only to further
simplify it.
We identified several kinds of problems: performance, design, thread-safety.
As we've said, fixing all those problems while not touching the API could be quite hard, and
IMO is a lot more effort than it's worth.

> Factory method to provide sampling from distributions
> -----------------------------------------------------
>                 Key: MATH-1158
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>    Affects Versions: 3.3
>            Reporter: Gilles
>            Priority: Minor
>              Labels: API, deprecation
>             Fix For: 3.4
>         Attachments: MATH-1158.patch
> A proposal to separate the sampling functionality from the core of the distribution classes.

This message was sent by Atlassian JIRA

View raw message