sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
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 GMT
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 <var>U</var> matrix that satisfies {@code this} × <var>U</var>
= {@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 <code>NoninvertibleTransformException</code>
because the matrices in this package
  *        are used in <cite>Coordinate Operation Steps</cite>, 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();
 



Mime
View raw message