commons-issues mailing list archives

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


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


> A fast and stable SVD implementation from JAMA
> ----------------------------------------------
>                 Key: MATH-611
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.0, Nightly Builds
>            Reporter: Christopher Nix
>              Labels: patch
>             Fix For: 3.0, Nightly Builds
>         Attachments:
> 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:


View raw message