Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 92623 invoked from network); 4 Dec 2008 15:42:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 15:42:54 -0000 Received: (qmail 65082 invoked by uid 500); 4 Dec 2008 15:43:01 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 64982 invoked by uid 500); 4 Dec 2008 15:43:01 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 64961 invoked by uid 99); 4 Dec 2008 15:43:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 07:43:01 -0800 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.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 15:41:40 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A05AE238887A; Thu, 4 Dec 2008 07:41:58 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r723359 - in /commons/proper/math/trunk/src/java/org/apache/commons/math: MessagesResources_fr.java linear/RealMatrixImpl.java Date: Thu, 04 Dec 2008 15:41:58 -0000 To: commits@commons.apache.org From: luc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081204154158.A05AE238887A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: luc Date: Thu Dec 4 07:41:57 2008 New Revision: 723359 URL: http://svn.apache.org/viewvc?rev=723359&view=rev Log: improved error messages Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/MessagesResources_fr.java commons/proper/math/trunk/src/java/org/apache/commons/math/linear/RealMatrixImpl.java Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/MessagesResources_fr.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/MessagesResources_fr.java?rev=723359&r1=723358&r2=723359&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/MessagesResources_fr.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/MessagesResources_fr.java Thu Dec 4 07:41:57 2008 @@ -174,8 +174,6 @@ // org.apache.commons.math.linear.EigenDecompositionImpl { "cannot solve degree {0} equation", "impossible de r\u00e9soudre une \u00e9quation de degr\u00e9 {0}" }, - { "negative element on decomposed tridiagonal of {0}x{1} matrix", - "\u00e9l\u00e9ment n\u00e9gatif dans la d\u00e9composition tri-diagonale d''une matrice {0}x{1}" }, // org.apache.commons.math.linear.NonSquareMatrixException { "a {0}x{1} matrix was provided instead of a square matrix", @@ -209,6 +207,12 @@ "tableau des indices de lignes s\u00e9lectionn\u00e9es vide" }, { "empty selected column index array", "tableau des indices de colonnes s\u00e9lectionn\u00e9es vide" }, + { "{0}x{1} and {2}x{3} matrices are not multiplication compatible", + "les dimensions {0}x{1} et {2}x{3} sont incompatibles pour la multiplication matricielle" }, + { "{0}x{1} and {2}x{3} matrices are not addition compatible", + "les dimensions {0}x{1} et {2}x{3} sont incompatibles pour l'addition matricielle" }, + { "{0}x{1} and {2}x{3} matrices are not subtraction compatible", + "les dimensions {0}x{1} et {2}x{3} sont incompatibles pour la soustraction matricielle" }, // org.apache.commons.math.random.EmpiricalDistributionImpl // org.apache.commons.math.random.ValueServer Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/linear/RealMatrixImpl.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/linear/RealMatrixImpl.java?rev=723359&r1=723358&r2=723359&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/linear/RealMatrixImpl.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/linear/RealMatrixImpl.java Thu Dec 4 07:41:57 2008 @@ -174,7 +174,12 @@ final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); if (columnCount != m.getColumnDimension() || rowCount != m.getRowDimension()) { - throw new IllegalArgumentException("matrix dimension mismatch"); + throw MathRuntimeException.createIllegalArgumentException("{0}x{1} and {2}x{3} matrices are not" + + " addition compatible", + new Object[] { + getRowDimension(), getColumnDimension(), + m.getRowDimension(), m.getColumnDimension() + }); } final double[][] outData = new double[rowCount][columnCount]; for (int row = 0; row < rowCount; row++) { @@ -199,7 +204,12 @@ final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); if (columnCount != m.getColumnDimension() || rowCount != m.getRowDimension()) { - throw new IllegalArgumentException("matrix dimension mismatch"); + throw MathRuntimeException.createIllegalArgumentException("{0}x{1} and {2}x{3} matrices are not" + + " addition compatible", + new Object[] { + getRowDimension(), getColumnDimension(), + m.getRowDimension(), m.getColumnDimension() + }); } final double[][] outData = new double[rowCount][columnCount]; for (int row = 0; row < rowCount; row++) { @@ -221,7 +231,12 @@ final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); if (columnCount != m.getColumnDimension() || rowCount != m.getRowDimension()) { - throw new IllegalArgumentException("matrix dimension mismatch"); + throw MathRuntimeException.createIllegalArgumentException("{0}x{1} and {2}x{3} matrices are not" + + " subtraction compatible", + new Object[] { + getRowDimension(), getColumnDimension(), + m.getRowDimension(), m.getColumnDimension() + }); } final double[][] outData = new double[rowCount][columnCount]; for (int row = 0; row < rowCount; row++) { @@ -246,7 +261,12 @@ final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); if (columnCount != m.getColumnDimension() || rowCount != m.getRowDimension()) { - throw new IllegalArgumentException("matrix dimension mismatch"); + throw MathRuntimeException.createIllegalArgumentException("{0}x{1} and {2}x{3} matrices are not" + + " subtraction compatible", + new Object[] { + getRowDimension(), getColumnDimension(), + m.getRowDimension(), m.getColumnDimension() + }); } final double[][] outData = new double[rowCount][columnCount]; for (int row = 0; row < rowCount; row++) { @@ -296,7 +316,12 @@ return multiply((RealMatrixImpl) m); } catch (ClassCastException cce) { if (this.getColumnDimension() != m.getRowDimension()) { - throw new IllegalArgumentException("Matrices are not multiplication compatible."); + throw MathRuntimeException.createIllegalArgumentException("{0}x{1} and {2}x{3} matrices are not" + + " multiplication compatible", + new Object[] { + getRowDimension(), getColumnDimension(), + m.getRowDimension(), m.getColumnDimension() + }); } final int nRows = this.getRowDimension(); final int nCols = m.getColumnDimension(); @@ -326,7 +351,12 @@ */ public RealMatrixImpl multiply(RealMatrixImpl m) throws IllegalArgumentException { if (this.getColumnDimension() != m.getRowDimension()) { - throw new IllegalArgumentException("Matrices are not multiplication compatible."); + throw MathRuntimeException.createIllegalArgumentException("{0}x{1} and {2}x{3} matrices are not" + + " multiplication compatible", + new Object[] { + getRowDimension(), getColumnDimension(), + m.getRowDimension(), m.getColumnDimension() + }); } final int nRows = this.getRowDimension(); final int nCols = m.getColumnDimension();