sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1528795 - in /sis/branches/JDK7/core: sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/ sis-utility/src/main/java/org/apache/sis/internal/util/ sis-utility/src/test/java/org/apache/sis/internal/util/
Date Thu, 03 Oct 2013 10:38:42 GMT
Author: desruisseaux
Date: Thu Oct  3 10:38:42 2013
New Revision: 1528795

URL: http://svn.apache.org/r1528795
Log:
Renamed the STRICTFP constant as DISABLED. The old name was giving the impression that
non-STRICTFP calculations were platform-dependant (by analogy with the Java 'strictfp'
keyword), while it was not the case.

Modified:
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java

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=1528795&r1=1528794&r2=1528795&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] Thu Oct  3 10:38:42 2013
@@ -59,7 +59,7 @@ public abstract strictfp class MatrixTes
      * The matrix elements used in this class varies between 0 and 100,
      * and the {@code Math.ulp(100.0)} value is approximatively 1.4E-14.
      */
-    static final double TOLERANCE = DoubleDouble.STRICTFP ? STRICT : 1E-8;
+    static final double TOLERANCE = DoubleDouble.DISABLED ? STRICT : 1E-8;
 
     /**
      * Number of random matrices to try in arithmetic operation tests.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java?rev=1528795&r1=1528794&r2=1528795&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
[UTF-8] Thu Oct  3 10:38:42 2013
@@ -67,7 +67,7 @@ public final class DoubleDouble extends 
      * are immediately followed by a clearing of {@link DoubleDouble#error}.  The result
should then be
      * identical to computation performed using the normal {@code double} arithmetic.
      *
-     * <p>Since this flag is static final, all expressions of the form {@code if (STRICTFP)}
should be
+     * <p>Since this flag is static final, all expressions of the form {@code if (DISABLED)}
should be
      * omitted by the compiler from the class files in normal operations.</p>
      *
      * <p>Setting this flag to {@code true} causes some JUnit tests to fail. This is
normal. The main
@@ -76,7 +76,7 @@ public final class DoubleDouble extends 
      * implementation. Since JAMA uses {@code double} arithmetic, SIS needs to disable {@code
double-double}
      * arithmetic if the results are to be compared for strict equality.</p>
      */
-    public static final boolean STRICTFP = false;
+    public static final boolean DISABLED = false;
 
     /**
      * For cross-version compatibility.
@@ -218,7 +218,7 @@ public final class DoubleDouble extends 
      *         the given value is assumed to be the most accurate available representation.
      */
     public static double errorForWellKnownValue(final double value) {
-        if (STRICTFP) return 0;
+        if (DISABLED) return 0;
         final int i = Arrays.binarySearch(VALUES, Math.abs(value));
         return (i >= 0) ? MathFunctions.xorSign(ERRORS[i], value) : 0;
     }
@@ -264,7 +264,7 @@ public final class DoubleDouble extends 
      */
     final void normalize() {
         error += (value - (value += error));
-        if (STRICTFP) error = 0;
+        if (DISABLED) error = 0;
     }
 
     /**
@@ -279,7 +279,7 @@ public final class DoubleDouble extends 
     public void setToQuickSum(final double a, final double b) {
         value = a + b;
         error = b - (value - a);
-        if (STRICTFP) error = 0;
+        if (DISABLED) error = 0;
     }
 
     /**
@@ -294,7 +294,7 @@ public final class DoubleDouble extends 
         value = a + b;
         final double v = value - a;
         error = (a - (value - v)) + (b - v);
-        if (STRICTFP) error = 0;
+        if (DISABLED) error = 0;
     }
 
     /**
@@ -315,7 +315,7 @@ public final class DoubleDouble extends 
         final double bhi = t - (t - b);
         final double blo = b - bhi;
         error = ((ahi*bhi - value) + ahi*blo + alo*bhi) + alo*blo;
-        if (STRICTFP) error = 0;
+        if (DISABLED) error = 0;
     }
 
     /**
@@ -563,7 +563,7 @@ public final class DoubleDouble extends 
      * @param denominatorError The error of the other value by which to divide this {@code
DoubleDouble}.
      */
     public void divide(final double denominatorValue, final double denominatorError) {
-        if (STRICTFP) {
+        if (DISABLED) {
             value /= denominatorValue;
             error  = 0;
             return;

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java?rev=1528795&r1=1528794&r2=1528795&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java
[UTF-8] Thu Oct  3 10:38:42 2013
@@ -33,7 +33,7 @@ import static java.lang.StrictMath.*;
 
 /**
  * Tests {@link DoubleDouble} using {@link BigDecimal} as the references.
- * Those tests need {@link DoubleDouble#STRICTFP} to be set to {@code false}.
+ * Those tests need {@link DoubleDouble#DISABLED} to be set to {@code false}.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4



Mime
View raw message