Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 38647 invoked from network); 6 Nov 2009 15:14:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Nov 2009 15:14:55 -0000 Received: (qmail 28557 invoked by uid 500); 6 Nov 2009 15:14:55 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 28454 invoked by uid 500); 6 Nov 2009 15:14:54 -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 28444 invoked by uid 99); 6 Nov 2009 15:14:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Nov 2009 15:14:54 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI 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; Fri, 06 Nov 2009 15:14:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5BF53234C045 for ; Fri, 6 Nov 2009 07:14:32 -0800 (PST) Message-ID: <331580846.1257520472371.JavaMail.jira@brutus> Date: Fri, 6 Nov 2009 15:14:32 +0000 (UTC) From: "Luc Maisonobe (JIRA)" To: issues@commons.apache.org Subject: [jira] Resolved: (MATH-318) wrong result in eigen decomposition In-Reply-To: <27199760.1257520232521.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luc Maisonobe resolved MATH-318. -------------------------------- Resolution: Fixed fixed in subversion repository as of r833433. Thanks again to Dimitri would found and fixed this bug. > wrong result in eigen decomposition > ----------------------------------- > > Key: MATH-318 > URL: https://issues.apache.org/jira/browse/MATH-318 > Project: Commons Math > Issue Type: Bug > Affects Versions: 2.0 > Reporter: Luc Maisonobe > Fix For: 2.1 > > > Some results computed by EigenDecompositionImpl are wrong. The following case computed by Fortran Lapack fails with version 2.0 > {code} > public void testMathpbx02() { > double[] mainTridiagonal = { > 7484.860960227216, 18405.28129035345, 13855.225609560746, > 10016.708722343366, 559.8117399576674, 6750.190788301587, > 71.21428769782159 > }; > double[] secondaryTridiagonal = { > -4175.088570476366,1975.7955858241994,5193.178422374075, > 1995.286659169179,75.34535882933804,-234.0808002076056 > }; > // the reference values have been computed using routine DSTEMR > // from the fortran library LAPACK version 3.2.1 > double[] refEigenValues = { > 20654.744890306974412,16828.208208485466457, > 6893.155912634994820,6757.083016675340332, > 5887.799885688558788,64.309089923240379, > 57.992628792736340 > }; > RealVector[] refEigenVectors = { > new ArrayRealVector(new double[] {-0.270356342026904, 0.852811091326997, 0.399639490702077, 0.198794657813990, 0.019739323307666, 0.000106983022327, -0.000001216636321}), > new ArrayRealVector(new double[] {0.179995273578326,-0.402807848153042,0.701870993525734,0.555058211014888,0.068079148898236,0.000509139115227,-0.000007112235617}), > new ArrayRealVector(new double[] {-0.399582721284727,-0.056629954519333,-0.514406488522827,0.711168164518580,0.225548081276367,0.125943999652923,-0.004321507456014}), > new ArrayRealVector(new double[] {0.058515721572821,0.010200130057739,0.063516274916536,-0.090696087449378,-0.017148420432597,0.991318870265707,-0.034707338554096}), > new ArrayRealVector(new double[] {0.855205995537564,0.327134656629775,-0.265382397060548,0.282690729026706,0.105736068025572,-0.009138126622039,0.000367751821196}), > new ArrayRealVector(new double[] {-0.002913069901144,-0.005177515777101,0.041906334478672,-0.109315918416258,0.436192305456741,0.026307315639535,0.891797507436344}), > new ArrayRealVector(new double[] {-0.005738311176435,-0.010207611670378,0.082662420517928,-0.215733886094368,0.861606487840411,-0.025478530652759,-0.451080697503958}) > }; > // the following line triggers the exception > EigenDecomposition decomposition = > new EigenDecompositionImpl(mainTridiagonal, secondaryTridiagonal, MathUtils.SAFE_MIN); > double[] eigenValues = decomposition.getRealEigenvalues(); > for (int i = 0; i < refEigenValues.length; ++i) { > assertEquals(refEigenValues[i], eigenValues[i], 1.0e-3); > if (refEigenVectors[i].dotProduct(decomposition.getEigenvector(i)) < 0) { > assertEquals(0, refEigenVectors[i].add(decomposition.getEigenvector(i)).getNorm(), 1.0e-5); > } else { > assertEquals(0, refEigenVectors[i].subtract(decomposition.getEigenvector(i)).getNorm(), 1.0e-5); > } > } > } > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.