Author: desruisseaux
Date: Thu Oct 3 14:24:22 2013
New Revision: 1528884
URL: http://svn.apache.org/r1528884
Log:
Cleaning: remove unused 'precision' argument.
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/Matrices.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrix.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=1528884&r1=1528883&r2=1528884&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] Thu Oct 3 14:24:22 2013
@@ -95,39 +95,29 @@ class GeneralMatrix extends MatrixSIS {
* @param numRow Number of rows.
* @param numCol Number of columns.
* @param elements Initial values.
- * @param precision 1 for normal precision, or 2 for extended precision.
- * No other value is allowed (this is not verified).
*/
- GeneralMatrix(final int numRow, final int numCol, final double[] elements,
final int precision) {
+ GeneralMatrix(final int numRow, final int numCol, final double[] elements)
{
ensureValidSize(numRow, numCol);
final int length = numRow * numCol;
ensureLengthMatch(length, elements);
this.numRow = (short) numRow;
this.numCol = (short) numCol;
- this.elements = Arrays.copyOf(elements, length * precision);
- if (precision != 1) {
- inferErrors(this.elements);
- }
+ this.elements = Arrays.copyOf(elements, length);
}
/**
* Constructs a new matrix and copies the initial values from the given
matrix.
*
* @param matrix The matrix to copy.
- * @param precision 1 for normal precision, or 2 for extended precision.
- * No other value is allowed (this is not verified).
*/
- GeneralMatrix(final Matrix matrix, final int precision) {
+ GeneralMatrix(final Matrix matrix) {
final int numRow = matrix.getNumRow();
final int numCol = matrix.getNumCol();
ensureValidSize(numRow, numCol);
this.numRow = (short) numRow;
this.numCol = (short) numCol;
- elements = new double[numRow * numCol * precision];
+ elements = new double[numRow * numCol];
getElements(matrix, numRow, numCol, elements);
- if (precision != 1) {
- inferErrors(elements);
- }
}
/**
Modified:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java?rev=1528884&r1=1528883&r2=1528884&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
[UTF-8] (original)
+++
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
[UTF-8] Thu Oct 3 14:24:22 2013
@@ -175,9 +175,9 @@ public final class Matrices extends Stat
case 2: return new Matrix2(elements);
case 3: return new Matrix3(elements);
case 4: return new Matrix4(elements);
- default: return new GeneralMatrix(numRow, numCol, elements, 1);
+ default: return new GeneralMatrix(numRow, numCol, elements);
}
- return new NonSquareMatrix(numRow, numCol, elements, 1);
+ return new NonSquareMatrix(numRow, numCol, elements);
}
/**
@@ -650,15 +650,16 @@ public final class Matrices extends Stat
return null;
}
final int size = matrix.getNumRow();
- if (size == matrix.getNumCol()) {
- switch (size) {
- case 1: return new Matrix1(matrix);
- case 2: return new Matrix2(matrix);
- case 3: return new Matrix3(matrix);
- case 4: return new Matrix4(matrix);
- }
+ if (size != matrix.getNumCol()) {
+ return new NonSquareMatrix(matrix);
+ }
+ switch (size) {
+ case 1: return new Matrix1(matrix);
+ case 2: return new Matrix2(matrix);
+ case 3: return new Matrix3(matrix);
+ case 4: return new Matrix4(matrix);
}
- return new GeneralMatrix(matrix, 1);
+ return new GeneralMatrix(matrix);
}
/**
Modified:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrix.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrix.java?rev=1528884&r1=1528883&r2=1528884&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrix.java
[UTF-8] (original)
+++
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrix.java
[UTF-8] Thu Oct 3 14:24:22 2013
@@ -58,20 +58,18 @@ final class NonSquareMatrix extends Gene
* @param numRow Number of rows.
* @param numCol Number of columns.
* @param elements Initial values.
- * @param precision 1 for normal precision, or 2 for extended precision.
*/
- NonSquareMatrix(final int numRow, final int numCol, final double[]
elements, final int precision) {
- super(numRow, numCol, elements, precision);
+ NonSquareMatrix(final int numRow, final int numCol, final double[]
elements) {
+ super(numRow, numCol, elements);
}
/**
* Constructs a new matrix and copies the initial values from the given
matrix.
*
* @param matrix The matrix to copy.
- * @param precision 1 for normal precision, or 2 for extended precision.
*/
- NonSquareMatrix(final Matrix matrix, final int precision) {
- super(matrix, precision);
+ NonSquareMatrix(final Matrix matrix) {
+ super(matrix);
}
/**