You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Rob Tompkins (JIRA)" <ji...@apache.org> on 2017/04/22 14:21:04 UTC
[jira] [Updated] (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:all-tabpanel ]
Rob Tompkins updated MATH-1382:
-------------------------------
Fix Version/s: 4.0
> 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)