You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Stefan Bunk (JIRA)" <ji...@apache.org> on 2016/08/04 09:03:20 UTC

[jira] [Commented] (MATH-1382) MultivariateNormalDistribution.density() unnecessarily copies means array in loop

    [ https://issues.apache.org/jira/browse/MATH-1382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15407451#comment-15407451 ] 

Stefan Bunk commented on MATH-1382:
-----------------------------------

Fixed in https://github.com/apache/commons-math/pull/42

> 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
>
> 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.4#6332)