commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: [MATH] Density functions for all continuous distributions gives rise to re-consider the HasDensity-interface
Date Sun, 24 Jan 2010 04:58:56 GMT
Mikkel Meyer Andersen wrote:
> Dear Community.
> 
> I've just been going through all the continuous distributions in the
> MATH-library to check which implemented the HasDensity<P>-interface.
> 
> Only the F-distribution, t-distribution, Weibull distribution, and
> Cauchy distribution didn't implement it, and with MATH-330
> (https://issues.apache.org/jira/browse/MATH-330 - patch for the
> F-distribution) and MATH-331
> (https://issues.apache.org/jira/browse/MATH-331 - patches for the
> rest) both made by me that should now be corrected.
> 
> This means that now every continuous distribution implements
> HasDensity<Double>. Wouldn't it then be a good idea to put a double
> density(Double x)-method in the ContinuousDistribution-interface? It
> would give a lot of advantages, e.g. in regards to dynamic
> dispatching.
> 
> What do you think?

Great work!

I will complete review and commit if someone does not beat me to it.

Technically, adding to the ContinuousDistribution interface is a
compatibility break, so should wait until 3.0; but if we follow
Ted's suggestion of adding a default impl to
AbstractContinuousDistribution, the only users actually impacted
would be those who have implemented distributions that do not derive
from AbstractContinuousDistribution.  I wonder how many of these
there are.

I am +1 on this change, but understand if others are not comfortable
with the compatibility break.

Phil


> 
> Cheers, Mikkel.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message