Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 43122 invoked from network); 27 Oct 2009 03:18:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Oct 2009 03:18:39 -0000 Received: (qmail 97469 invoked by uid 500); 27 Oct 2009 03:18:38 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 97157 invoked by uid 500); 27 Oct 2009 03:18:38 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 97133 invoked by uid 99); 27 Oct 2009 03:18:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 03:18:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 03:18:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4203C234C04C for ; Mon, 26 Oct 2009 20:18:14 -0700 (PDT) Message-ID: <1686853825.1256613494269.JavaMail.jira@brutus> Date: Tue, 27 Oct 2009 03:18:14 +0000 (UTC) From: "Bruce A Johnson (JIRA)" To: issues@commons.apache.org Subject: [jira] Issue Comment Edited: (MATH-297) Eigenvector computation incorrectly returning vectors of NaNs In-Reply-To: <479156342.1253457195979.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12770367#action_12770367 ] Bruce A Johnson edited comment on MATH-297 at 10/27/09 3:16 AM: ---------------------------------------------------------------- There still seems to be a problem with the decomposition of some matrices. For example, the decomposition of the identity matrix '{{1,0},{0,1}}' yields the correct eigenvalues, but NaN for all the eigenvector elements. Crucially, the "isIncludedColumn" in the EigenDecompositionImplTest.java file always returns true (at least on my system) when the calculated eigenvectors have NaN elements, so is useless as a test for this problem. Also, I discovered this problem when getting NaN values doing an SVD of certain matrices (where each row has only one non-zero value). Since the SVD algorithm uses the EigenDecompositionImpl code, this seems to be a result of this current bug. (And ironically, I just told my students that one reason people love the SVD is that it essentially never fails). was (Author: bjohnson): There still seems to be a problem with the decomposition of some matrices. For example, the decomposition of the identity matrix "{{1,0},{0,1}}" yields the correct eigenvalues, but NaN for all the eigenvector elements. Crucially, the "isIncludedColumn" in the EigenDecompositionImplTest.java file always returns true (at least on my system) when the calculated eigenvectors have NaN elements, so is useless as a test for this problem. Also, I discovered this problem when getting NaN values doing an SVD of certain matrices (where each row has only one non-zero value). Since the SVD algorithm uses the EigenDecompositionImpl code, this seems to be a result of this current bug. (And ironically, I just told my students that one reason people love the SVD is that it essentially never fails). > Eigenvector computation incorrectly returning vectors of NaNs > ------------------------------------------------------------- > > Key: MATH-297 > URL: https://issues.apache.org/jira/browse/MATH-297 > Project: Commons Math > Issue Type: Bug > Affects Versions: 2.0 > Reporter: Phil Steitz > Fix For: 2.1 > > > As reported by Axel Kramer on commons-dev, the following test case succeeds, but should fail: > {code} > public void testEigenDecomposition() { > double[][] m = { { 0.0, 1.0, -1.0 }, { 1.0, 1.0, 0.0 }, { -1.0,0.0, 1.0 } }; > RealMatrix rm = new Array2DRowRealMatrix(m); > assertEquals(rm.toString(), > "Array2DRowRealMatrix{{0.0,1.0,-1.0},{1.0,1.0,0.0},{-1.0,0.0,1.0}}"); > EigenDecompositionImpl ed = new EigenDecompositionImpl(rm, > MathUtils.SAFE_MIN); > RealVector rv0 = ed.getEigenvector(0); > assertEquals(rv0.toString(), "{(NaN); (NaN); (NaN)}"); > } > {code} > ed.getRealEigenvalues() returns the correct eigenvalues (2, 1, -1), but all three eigenvectors contain only NaNs. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.