[ 
https://issues.apache.org/jira/browse/MATH-1382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gilles resolved MATH-1382.
--------------------------
    Resolution: Fixed

commit dff1a0953d97d46290750a46d01be1e1519ae698

Thanks for the report (and sorry for the delay in updating the code).

> MultivariateNormalDistribution.density() unnecessarily copies means array in 
> loop
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-1382
>                 URL: https://issues.apache.org/jira/browse/MATH-1382
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.6.1
>            Reporter: Stefan Bunk
>            Priority: Trivial
>              Labels: easyfix
>             Fix For: 4.0
>
>
> In the class MultivariateNormalDistribution, the public method density() 
> calls the private method getExponentTerm(), which first centers the given 
> instance by the mean.
> However, it is using the method getMeans(), which creates a copy of means 
> array each time, just for reading the i-th index.
> See 
> https://github.com/apache/commons-math/blob/3.6.1-release/src/main/java/org/apache/commons/math3/distribution/MultivariateNormalDistribution.java#L238
> A solution should use the private variable `means` directly.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to