sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1522053 - in /sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix: GeneralMatrix.java Matrix1.java Matrix2.java Matrix3.java Matrix4.java MatrixSIS.java
Date Wed, 11 Sep 2013 21:22:12 GMT
Author: desruisseaux
Date: Wed Sep 11 21:22:11 2013
New Revision: 1522053

URL: http://svn.apache.org/r1522053
Log:
Simplication: a search in the code base has shown that 'negate()' was not used, so remove
(for now) that method.
Renamed 'transpose()' to 'setToTranspose()' for making clear that the result replaces the
previous matrix.

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

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=1522053&r1=1522052&r2=1522053&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] Wed Sep 11 21:22:11 2013
@@ -246,17 +246,7 @@ class GeneralMatrix extends MatrixSIS {
      * {@inheritDoc}
      */
     @Override
-    public final void negate() {
-        for (int i=0; i<elements.length; i++) {
-            elements[i] = -elements[i];
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public final void transpose() {
+    public final void setToTranspose() {
         for (int j=0; j<numRow; j++) {
             for (int i=0; i<j; i++) {
                 final int lowerLeft  = j*numCol + i;

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=1522053&r1=1522052&r2=1522053&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] Wed Sep 11 21:22:11 2013
@@ -221,19 +221,10 @@ public final class Matrix1 extends Matri
     }
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void negate() {
-        m00 = -m00;
-    }
-
-    /**
-     * Sets the value of this matrix to its transpose.
      * For a 1×1 matrix, this method does nothing.
      */
     @Override
-    public void transpose() {
+    public void setToTranspose() {
         // Nothing to do for a 1x1 matrix.
     }
 

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=1522053&r1=1522052&r2=1522053&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] Wed Sep 11 21:22:11 2013
@@ -241,18 +241,7 @@ public final class Matrix2 extends Matri
      * {@inheritDoc}
      */
     @Override
-    public void negate() {
-        m00 = -m00;
-        m01 = -m01;
-        m10 = -m10;
-        m11 = -m11;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void transpose() {
+    public void setToTranspose() {
         final double swap = m10;
         m10 = m01;
         m01 = swap;

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=1522053&r1=1522052&r2=1522053&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] Wed Sep 11 21:22:11 2013
@@ -290,23 +290,7 @@ public final class Matrix3 extends Matri
      * {@inheritDoc}
      */
     @Override
-    public void negate() {
-        m00 = -m00;
-        m01 = -m01;
-        m02 = -m02;
-        m10 = -m10;
-        m11 = -m11;
-        m12 = -m12;
-        m20 = -m20;
-        m21 = -m21;
-        m22 = -m22;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void transpose() {
+    public void setToTranspose() {
         double swap;
         swap = m01; m01 = m10; m10 = swap;
         swap = m02; m02 = m20; m20 = swap;

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=1522053&r1=1522052&r2=1522053&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] Wed Sep 11 21:22:11 2013
@@ -338,30 +338,7 @@ public final class Matrix4 extends Matri
      * {@inheritDoc}
      */
     @Override
-    public void negate() {
-        m00 = -m00;
-        m01 = -m01;
-        m02 = -m02;
-        m03 = -m03;
-        m10 = -m10;
-        m11 = -m11;
-        m12 = -m12;
-        m13 = -m13;
-        m20 = -m20;
-        m21 = -m21;
-        m22 = -m22;
-        m23 = -m23;
-        m30 = -m30;
-        m31 = -m31;
-        m32 = -m32;
-        m33 = -m33;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void transpose() {
+    public void setToTranspose() {
         double swap;
         swap = m01; m01 = m10; m10 = swap;
         swap = m02; m02 = m20; m20 = swap;

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=1522053&r1=1522052&r2=1522053&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
Wed Sep 11 21:22:11 2013
@@ -32,7 +32,7 @@ import org.apache.sis.util.resources.Err
  *
  * <ul>
  *   <li>basic operations needed for <cite>referencing by coordinates</cite>:
- *       {@link #negate()}, {@link #transpose()}, {@link #inverse()}, {@link #multiply(Matrix)};</li>
+ *       {@link #setToTranspose()}, {@link #inverse()}, {@link #multiply(Matrix)};</li>
  *   <li>some operations more specific to referencing by coordinates:
  *       {@link #isAffine()}, {@link #normalizeColumns()}.</li>
  * </ul>
@@ -168,14 +168,9 @@ public abstract class MatrixSIS implemen
     public abstract void setToIdentity();
 
     /**
-     * Negates the values of this matrix: {@code this} = {@code -this}.
-     */
-    public abstract void negate();
-
-    /**
      * Sets the value of this matrix to its transpose.
      */
-    public abstract void transpose();
+    public abstract void setToTranspose();
 
     /**
      * Normalizes all columns in-place. Each columns in this matrix is considered as a vector.



Mime
View raw message