mod number format


Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/d8f1005b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/d8f1005b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/d8f1005b

Branch: refs/heads/JIRA-22/pr-385
Commit: d8f1005bb9fbf769b117290582bed18d7607a94a
Parents: d3009be
Author: amaya <g...@sapphire.in.net>
Authored: Tue Sep 20 12:01:46 2016 +0900
Committer: amaya <g...@sapphire.in.net>
Committed: Tue Sep 20 12:01:46 2016 +0900

----------------------------------------------------------------------
 .../hivemall/tools/matrix/TransposeAndDotUDAF.java    |  2 +-
 .../src/main/java/hivemall/utils/math/StatsUtils.java | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/d8f1005b/core/src/main/java/hivemall/tools/matrix/TransposeAndDotUDAF.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/hivemall/tools/matrix/TransposeAndDotUDAF.java 
b/core/src/main/java/hivemall/tools/matrix/TransposeAndDotUDAF.java
index 4fa5ce4..3dcbb93 100644
--- a/core/src/main/java/hivemall/tools/matrix/TransposeAndDotUDAF.java
+++ b/core/src/main/java/hivemall/tools/matrix/TransposeAndDotUDAF.java
@@ -81,7 +81,7 @@ public final class TransposeAndDotUDAF extends 
AbstractGenericUDAFResolver {
             public void reset() {
                 if (aggMatrix != null) {
                     for (double[] row : aggMatrix) {
-                        Arrays.fill(row, 0.0);
+                        Arrays.fill(row, 0.d);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/d8f1005b/core/src/main/java/hivemall/utils/math/StatsUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/hivemall/utils/math/StatsUtils.java 
b/core/src/main/java/hivemall/utils/math/StatsUtils.java
index ffccea3..7633419 100644
--- a/core/src/main/java/hivemall/utils/math/StatsUtils.java
+++ b/core/src/main/java/hivemall/utils/math/StatsUtils.java
@@ -198,22 +198,22 @@ public final class StatsUtils {
     public static double chiSquare(@Nonnull final double[] expected, @Nonnull 
final double[] observed) {
         Preconditions.checkArgument(expected.length == observed.length);
 
-        double sumExpected = 0.0D;
-        double sumObserved = 0.0D;
+        double sumExpected = 0.d;
+        double sumObserved = 0.d;
 
         for (int ratio = 0; ratio < observed.length; ++ratio) {
             sumExpected += expected[ratio];
             sumObserved += observed[ratio];
         }
 
-        double var15 = 1.0D;
+        double var15 = 1.d;
         boolean rescale = false;
-        if (Math.abs(sumExpected - sumObserved) > 1.0E-5D) {
+        if (Math.abs(sumExpected - sumObserved) > 1.e-5) {
             var15 = sumObserved / sumExpected;
             rescale = true;
         }
 
-        double sumSq = 0.0D;
+        double sumSq = 0.d;
 
         for (int i = 0; i < observed.length; ++i) {
             double dev;
@@ -235,7 +235,7 @@ public final class StatsUtils {
      * @return p-value
      */
     public static double chiSquareTest(@Nonnull final double[] 
expected,@Nonnull final double[] observed) {
-        ChiSquaredDistribution distribution = new ChiSquaredDistribution(null, 
(double)expected.length - 1.0D);
-        return 1.0D - distribution.cumulativeProbability(chiSquare(expected, 
observed));
+        ChiSquaredDistribution distribution = new ChiSquaredDistribution(null, 
(double)expected.length - 1.d);
+        return 1.d - distribution.cumulativeProbability(chiSquare(expected, 
observed));
     }
 }

Reply via email to