commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Nix (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-611) A fast and stable SVD implementation from JAMA
Date Wed, 06 Jul 2011 11:10:16 GMT

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

Christopher Nix commented on MATH-611:
--------------------------------------

With regard to speed, I've tried it on random arrays with up to 1,000,000 elements and it's
definitely faster than the current SVD implementation.

The current SVD implementation is noticeably slowed by the implementations of AbstractRealMatrix
and TriDiagonalTransformer that use setEntry and getEntry on matrices within loops.  As such,
matrix indices are checked to be in bounds at every iteration of a loop, when what we really
should do is check the max and min indices only, if at all. (I've a further patch yet to submit
on this).

If we remove the use of getEntry and setEntry in methods called by the current SVD implementation,
and instead use direct array access, then the speed of the current implementation is improved
significantly, however the stability remains unchanged.  Even with this change, the JAMA code
is about twice as fast to converge (according to my profiler) and it is demonstrably more
accurate.

Chris.

> A fast and stable SVD implementation from JAMA
> ----------------------------------------------
>
>                 Key: MATH-611
>                 URL: https://issues.apache.org/jira/browse/MATH-611
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.0, Nightly Builds
>            Reporter: Christopher Nix
>              Labels: patch
>             Fix For: 3.0, Nightly Builds
>
>         Attachments: SingularValueDecompositionImpl.java
>
>
> Common numerical stability issues with the current SVD implementation, ie MATH-327, MATH-383,
MATH-465, MATH-583 can all be solved by co-opting JAMA code that is within the public domain.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message