[
https://issues.apache.org/jira/browse/MATH-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051663#comment-13051663
]
Luc Maisonobe commented on MATH-585:
------------------------------------
I was not suggesting a static field gammaRejectionSampler but a static inner
class GammaRejectionSampler since you already pass the outer class as an
argument to the constructor of the inner class.
You could also keep the inner class non-static but in this case you should not
pass the reference to the outer class as a constructor argument and store it by
yourself, but you should rely on the fact a non-static class is automatically
bound to the instance of the outer class it belongs to and it does already have
access to the outer class private fields. As you use randomData, this is
perhaps a better solution than having a static inner class.
> Very slow generation of gamma random variates
> ---------------------------------------------
>
> Key: MATH-585
> URL: https://issues.apache.org/jira/browse/MATH-585
> Project: Commons Math
> Issue Type: Improvement
> Affects Versions: 2.2, 3.0
> Environment: All
> Reporter: Darren Wilkinson
> Assignee: Mikkel Meyer Andersen
> Labels: Gamma, Random
> Attachments: MATH585-1.patch, MATH585-4-gamma.patch
>
> Original Estimate: 6h
> Remaining Estimate: 6h
>
> The current implementation of gamma random variate generation works, but uses
> an inversion method. This is well-known to be a bad idea. Usually a carefully
> constructed rejection procedure is used. To give an idea of the magnitude of
> the problem, the Gamma variate generation in Parallel COLT is roughly 50
> times faster than in Commons Math.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira