From 197169e47b093e80e357a79f3249e2445c9241b0 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 8 Aug 2011 13:34:04 -0400 Subject: [PATCH] Submitting patch from Larry Singh to make MathUtils compatible with java 1.7 --- .../org/broadinstitute/sting/utils/MathUtils.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) mode change 100755 => 100644 public/java/src/org/broadinstitute/sting/utils/MathUtils.java diff --git a/public/java/src/org/broadinstitute/sting/utils/MathUtils.java b/public/java/src/org/broadinstitute/sting/utils/MathUtils.java old mode 100755 new mode 100644 index 36ed506aa..cbe2948aa --- a/public/java/src/org/broadinstitute/sting/utils/MathUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/MathUtils.java @@ -147,13 +147,13 @@ public class MathUtils { return Math.log10(sum) + maxValue; } - public static double sum(List values) { + public static double sumDoubles(List values) { double s = 0.0; for ( double v : values) s += v; return s; } - public static int sum(List values) { + public static int sumIntegers(List values) { int s = 0; for ( int v : values) s += v; return s; @@ -428,7 +428,7 @@ public class MathUtils { // for precision purposes, we need to add (or really subtract, since they're // all negative) the largest value; also, we need to convert to normal-space. - double maxValue = MathUtils.arrayMax( array ); + double maxValue = MathUtils.arrayMaxDouble( array ); for (int i = 0; i < array.size(); i++) normalized[i] = Math.pow(10, array.get(i) - maxValue); @@ -507,7 +507,7 @@ public class MathUtils { return minI; } - public static int arrayMax(List array) { + public static int arrayMaxInt(List array) { if ( array == null ) throw new IllegalArgumentException("Array cannot be null!"); if ( array.size() == 0 ) throw new IllegalArgumentException("Array size cannot be 0!"); @@ -516,7 +516,7 @@ public class MathUtils { return m; } - public static double arrayMax(List array) { + public static double arrayMaxDouble(List array) { if ( array == null ) throw new IllegalArgumentException("Array cannot be null!"); if ( array.size() == 0 ) throw new IllegalArgumentException("Array size cannot be 0!"); @@ -1274,5 +1274,4 @@ public class MathUtils { public static double log10Factorial (int x) { return log10Gamma(x+1); } - -} \ No newline at end of file +}