You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Luc Maisonobe (JIRA)" <ji...@apache.org> on 2011/07/20 14:19:58 UTC
[jira] [Resolved] (MATH-383) MaxIterationsExceededException in SVD
(EigenDecompositionImpl.findEigenVectors ) caused by NaN
[ https://issues.apache.org/jira/browse/MATH-383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Luc Maisonobe resolved MATH-383.
--------------------------------
Resolution: Fixed
Fixed in subversion repository as of r1148714.
This issue was fixed by changing SVD implementation according to issue MATH-611.
> MaxIterationsExceededException in SVD (EigenDecompositionImpl.findEigenVectors ) caused by NaN
> ----------------------------------------------------------------------------------------------
>
> Key: MATH-383
> URL: https://issues.apache.org/jira/browse/MATH-383
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 3.0
> Environment: Java 6
> Reporter: Alexander Kushkuley
> Assignee: Dimitri Pourbaix
> Fix For: 3.0
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> In the following code fragment from EigenDecompositionImpl.findEigenVectors
> ....................................................................
> for (int j = 0; j < n; j++) {
> int its = 0;
> int m;
> do {
> for (m = j; m < n - 1; m++) {
> double delta = Math.abs(realEigenvalues[m]) + Math.abs(realEigenvalues[m + 1]);
> if (Math.abs(e[m]) + delta == delta) {
> break;
> }
> }
>
> if (m != j) {
> .........................................
> the test for "(Math.abs(e[m]) + delta == delta)" is not executed when m is equal to n -1.
> As a result e[m] == 0 (does happen!) causes variables q and realEigenvalues[m] to become NaN that in turn causes "Math.abs(e[m]) + delta == delta)" to become always false.
> My guess (seems to work) is that another test for e[m] == 0 is needed, so that the code becomes
> for (int j = 0; j < n; j++) {
> int its = 0;
> int m;
> do {
> for (m = j; m < n - 1; m++) {
> double delta = Math.abs(realEigenvalues[m]) + Math.abs(realEigenvalues[m + 1]);
> if (Math.abs(e[m]) + delta == delta) {
> break;
> }
> }
>
> // begin patch
> if ( m == n - 1 && e[m-1] == 0 )
> break;
> // end patch
>
> if (m != j) {
> .........................................
> or something like that
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira