Return-Path: X-Original-To: apmail-sis-commits-archive@www.apache.org Delivered-To: apmail-sis-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1F11A10C15 for ; Fri, 13 Sep 2013 17:02:02 +0000 (UTC) Received: (qmail 58967 invoked by uid 500); 13 Sep 2013 17:02:02 -0000 Delivered-To: apmail-sis-commits-archive@sis.apache.org Received: (qmail 58934 invoked by uid 500); 13 Sep 2013 17:02:02 -0000 Mailing-List: contact commits-help@sis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sis-dev@sis.apache.org Delivered-To: mailing list commits@sis.apache.org Received: (qmail 58926 invoked by uid 99); 13 Sep 2013 17:02:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Sep 2013 17:02:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Fri, 13 Sep 2013 17:01:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8ECB523888E7; Fri, 13 Sep 2013 17:01:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1523015 - in /sis/branches/JDK7/core/sis-referencing/src: main/java/org/apache/sis/referencing/operation/matrix/ test/java/org/apache/sis/referencing/operation/matrix/ Date: Fri, 13 Sep 2013 17:01:35 -0000 To: commits@sis.apache.org From: desruisseaux@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130913170135.8ECB523888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: desruisseaux Date: Fri Sep 13 17:01:34 2013 New Revision: 1523015 URL: http://svn.apache.org/r1523015 Log: Renamed SingularMatrixException as NoninvertibleMatrixException because the matrix can be non-invertible for other raisons than being a singular matrix. Added: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NoninvertibleMatrixException.java - copied, changed from r1522697, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/SingularMatrixException.java Removed: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/SingularMatrixException.java Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix1.java sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix2.java sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix3.java sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix4.java sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/MatrixSIS.java sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java?rev=1523015&r1=1523014&r2=1523015&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java [UTF-8] Fri Sep 13 17:01:34 2013 @@ -277,7 +277,7 @@ class GeneralMatrix extends MatrixSIS { * {@inheritDoc} */ @Override - public MatrixSIS inverse() throws SingularMatrixException { + public MatrixSIS inverse() throws NoninvertibleMatrixException { throw new UnsupportedOperationException(); // TODO } @@ -285,7 +285,7 @@ class GeneralMatrix extends MatrixSIS { * {@inheritDoc} */ @Override - public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, SingularMatrixException { + public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, NoninvertibleMatrixException { throw new UnsupportedOperationException(); // TODO } Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix1.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix1.java?rev=1523015&r1=1523014&r2=1523015&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix1.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix1.java [UTF-8] Fri Sep 13 17:01:34 2013 @@ -225,9 +225,9 @@ public final class Matrix1 extends Matri * {@inheritDoc} */ @Override - public MatrixSIS inverse() throws SingularMatrixException { + public MatrixSIS inverse() throws NoninvertibleMatrixException { if (m00 == 0) { - throw new SingularMatrixException(); + throw new NoninvertibleMatrixException(); } return new Matrix1(1 / m00); } @@ -236,11 +236,11 @@ public final class Matrix1 extends Matri * {@inheritDoc} */ @Override - public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, SingularMatrixException { + public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, NoninvertibleMatrixException { final int nc = matrix.getNumCol(); ensureNumRowMatch(SIZE, matrix, nc); if (m00 == 0) { - throw new SingularMatrixException(); + throw new NoninvertibleMatrixException(); } if (nc != SIZE) { final NonSquareMatrix m = new NonSquareMatrix(SIZE, nc, false); Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix2.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix2.java?rev=1523015&r1=1523014&r2=1523015&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix2.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix2.java [UTF-8] Fri Sep 13 17:01:34 2013 @@ -252,10 +252,10 @@ public final class Matrix2 extends Matri * {@inheritDoc} */ @Override - public MatrixSIS inverse() throws SingularMatrixException { + public MatrixSIS inverse() throws NoninvertibleMatrixException { final double det = m00*m11 - m01*m10; if (det == 0) { - throw new SingularMatrixException(); + throw new NoninvertibleMatrixException(); } return new Matrix2(m11 / det, -m01 / det, -m10 / det, m00 / det); @@ -265,7 +265,7 @@ public final class Matrix2 extends Matri * {@inheritDoc} */ @Override - public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, SingularMatrixException { + public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, NoninvertibleMatrixException { throw new UnsupportedOperationException(); // TODO } Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix3.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix3.java?rev=1523015&r1=1523014&r2=1523015&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix3.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix3.java [UTF-8] Fri Sep 13 17:01:34 2013 @@ -295,7 +295,7 @@ public final class Matrix3 extends Matri * {@inheritDoc} */ @Override - public MatrixSIS inverse() throws SingularMatrixException { + public MatrixSIS inverse() throws NoninvertibleMatrixException { throw new UnsupportedOperationException(); // TODO } @@ -303,7 +303,7 @@ public final class Matrix3 extends Matri * {@inheritDoc} */ @Override - public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, SingularMatrixException { + public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, NoninvertibleMatrixException { throw new UnsupportedOperationException(); // TODO } Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix4.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix4.java?rev=1523015&r1=1523014&r2=1523015&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix4.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix4.java [UTF-8] Fri Sep 13 17:01:34 2013 @@ -346,7 +346,7 @@ public final class Matrix4 extends Matri * {@inheritDoc} */ @Override - public MatrixSIS inverse() throws SingularMatrixException { + public MatrixSIS inverse() throws NoninvertibleMatrixException { throw new UnsupportedOperationException(); // TODO } @@ -354,7 +354,7 @@ public final class Matrix4 extends Matri * {@inheritDoc} */ @Override - public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, SingularMatrixException { + public MatrixSIS solve(final Matrix matrix) throws MismatchedMatrixSizeException, NoninvertibleMatrixException { throw new UnsupportedOperationException(); // TODO } Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/MatrixSIS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/MatrixSIS.java?rev=1523015&r1=1523014&r2=1523015&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/MatrixSIS.java (original) +++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/MatrixSIS.java Fri Sep 13 17:01:34 2013 @@ -197,19 +197,19 @@ public abstract class MatrixSIS implemen * @return The U matrix that satisfies {@code this} × U = {@code matrix}. * @throws MismatchedMatrixSizeException if the number of rows in the given matrix is not equals * to the number of columns in this matrix. - * @throws SingularMatrixException if this matrix is not invertible. + * @throws NoninvertibleMatrixException if this matrix is not invertible. */ - public abstract MatrixSIS solve(Matrix matrix) throws MismatchedMatrixSizeException, SingularMatrixException; + public abstract MatrixSIS solve(Matrix matrix) throws MismatchedMatrixSizeException, NoninvertibleMatrixException; /** * Returns the inverse of this matrix. * * @return The inverse of this matrix. - * @throws SingularMatrixException if this matrix is not invertible. + * @throws NoninvertibleMatrixException if this matrix is not invertible. * * @see java.awt.geom.AffineTransform#createInverse() */ - public abstract MatrixSIS inverse() throws SingularMatrixException; + public abstract MatrixSIS inverse() throws NoninvertibleMatrixException; /** * Compares the given matrices for equality, using the given absolute tolerance threshold. Copied: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NoninvertibleMatrixException.java (from r1522697, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/SingularMatrixException.java) URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NoninvertibleMatrixException.java?p2=sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NoninvertibleMatrixException.java&p1=sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/SingularMatrixException.java&r1=1522697&r2=1523015&rev=1523015&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/SingularMatrixException.java (original) +++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NoninvertibleMatrixException.java Fri Sep 13 17:01:34 2013 @@ -20,7 +20,8 @@ import org.opengis.referencing.operation /** - * Thrown when a matrix can not be inverted because it is singular. + * Thrown when a matrix can not be inverted. + * This may be because the matrix is singular, or because the matrix is not square. * * {@note This exception extends NoninvertibleTransformException because the matrices in this package * are used in Coordinate Operation Steps, in which case a singular matrix means that the @@ -31,7 +32,7 @@ import org.opengis.referencing.operation * @version 0.4 * @module */ -public class SingularMatrixException extends NoninvertibleTransformException { +public class NoninvertibleMatrixException extends NoninvertibleTransformException { /** * For cross-version compatibility. */ @@ -40,7 +41,7 @@ public class SingularMatrixException ext /** * Constructs a new exception with no message. */ - public SingularMatrixException() { + public NoninvertibleMatrixException() { super(); } @@ -49,7 +50,7 @@ public class SingularMatrixException ext * * @param message The detail message, or {@code null} if none. */ - public SingularMatrixException(final String message) { + public NoninvertibleMatrixException(final String message) { super(message); } @@ -59,7 +60,7 @@ public class SingularMatrixException ext * @param message The detail message, or {@code null} if none. * @param cause The cause, or {@code null} if none. */ - public SingularMatrixException(final String message, final Throwable cause) { + public NoninvertibleMatrixException(final String message, final Throwable cause) { super(message, cause); } } Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java?rev=1523015&r1=1523014&r2=1523015&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java [UTF-8] Fri Sep 13 17:01:34 2013 @@ -313,11 +313,11 @@ public abstract strictfp class MatrixTes /** * Tests {@link MatrixSIS#solve(Matrix)}. * - * @throws SingularMatrixException Should never happen. + * @throws NoninvertibleMatrixException Should never happen. */ @Test @DependsOnMethod("testMultiply") - public void testSolve() throws SingularMatrixException { + public void testSolve() throws NoninvertibleMatrixException { final int numRow = getNumRow(); final int numCol = getNumCol(); @@ -355,11 +355,11 @@ public abstract strictfp class MatrixTes * Tests {@link MatrixSIS#inverse()}. * SIS implements the {@code inverse} operation as a special case of the {@code solve} operation. * - * @throws SingularMatrixException Should never happen. + * @throws NoninvertibleMatrixException Should never happen. */ @Test @DependsOnMethod("testSolve") - public void testInverse() throws SingularMatrixException { + public void testInverse() throws NoninvertibleMatrixException { final int numRow = getNumRow(); final int numCol = getNumCol();