diff --git a/ant/build.xml b/ant/build.xml index 0748174e..b76f5a6b 100644 --- a/ant/build.xml +++ b/ant/build.xml @@ -290,8 +290,8 @@ - - + + diff --git a/ant/check.xml b/ant/check.xml index f195fb0a..62f270a9 100644 --- a/ant/check.xml +++ b/ant/check.xml @@ -1,6 +1,6 @@ - - + + + @@ -97,6 +101,8 @@ "> + +
- JavaEVA header + EvA header 5 /////////////////////////////////////////////////////////////////////////////// // Filename: $RCSfile$ diff --git a/src/simpleprobs/InterfaceSimpleProblem.java b/src/simpleprobs/InterfaceSimpleProblem.java index 93f72d51..85e8fae3 100644 --- a/src/simpleprobs/InterfaceSimpleProblem.java +++ b/src/simpleprobs/InterfaceSimpleProblem.java @@ -2,7 +2,7 @@ package simpleprobs; /** * A simple interface to easily include new optimization problems in Java into the - * JavaEvA framework. + * EvA framework. * * @author mkron * @@ -11,7 +11,7 @@ package simpleprobs; public interface InterfaceSimpleProblem { /** * Evaluate a double vector representing a possible problem solution as - * part of an individual in the JavaEvA framework. This makes up the + * part of an individual in the EvA framework. This makes up the * target function to be evaluated. * * @param x a double vector to be evaluated diff --git a/src/wsi/ra/math/RNG.java b/src/wsi/ra/math/RNG.java index d3790cc0..f1f707ba 100644 --- a/src/wsi/ra/math/RNG.java +++ b/src/wsi/ra/math/RNG.java @@ -268,7 +268,7 @@ public class RNG extends Random { } /** - * Create a random vector with gaussian random double entries. + * Create a normalized random vector with gaussian random double entries. * * @param n * @return @@ -278,7 +278,7 @@ public class RNG extends Random { for (int i = 0; i < result.length; i++) { result[i] = RNG.gaussianDouble(dev); } - Mathematics.normalizeVector(result); + Mathematics.normVect(result, result); return result; } } diff --git a/src/wsi/ra/tool/StatisticUtils.java b/src/wsi/ra/tool/StatisticUtils.java index ac53ad67..0780173c 100644 --- a/src/wsi/ra/tool/StatisticUtils.java +++ b/src/wsi/ra/tool/StatisticUtils.java @@ -14,6 +14,7 @@ package wsi.ra.tool; + /** * Statistic utils. */ @@ -177,25 +178,6 @@ public class StatisticUtils return maxIndex; } - /** - * Computes the mean for an array of doubles. - * - * @param vector the array - * @return the mean - */ - public static double mean(double[] vector) { - - double sum = 0; - - if (vector.length == 0) { - return 0; - } - for (int i = 0; i < vector.length; i++) { - sum += vector[i]; - } - return sum / (double) vector.length; - } - /** * Returns index of minimum element in a given * array of integers. First minimum is returned. @@ -240,43 +222,6 @@ public class StatisticUtils return minIndex; } - /** - * Normalizes the doubles in the array by their sum. - * - * @param doubles the array of double - * @exception IllegalArgumentException if sum is Zero or NaN - */ - public static void normalize(double[] doubles) { - - double sum = 0; - for (int i = 0; i < doubles.length; i++) { - sum += doubles[i]; - } - normalize(doubles, sum); - } - - /** - * Normalizes the doubles in the array using the given value. - * - * @param doubles the array of double - * @param sum the value by which the doubles are to be normalized - * @exception IllegalArgumentException if sum is zero or NaN - */ - public static void normalize(double[] doubles, double sum) { - - if (Double.isNaN(sum)) { - throw new IllegalArgumentException("Can't normalize array. Sum is NaN."); - } - if (sum == 0) { - // Maybe this should just be a return. - throw new IllegalArgumentException("Can't normalize array. Sum is zero."); - } - for (int i = 0; i < doubles.length; i++) { - doubles[i] /= sum; - } - } - - /** * Computes the variance for an array of doubles. * @@ -305,54 +250,6 @@ public class StatisticUtils } } - /** - * Computes the sum of the elements of an array of doubles. - * - * @param doubles the array of double - * @return the sum of the elements - */ - public static double sum(double[] doubles) { - - double sum = 0; - - for (int i = 0; i < doubles.length; i++) { - sum += doubles[i]; - } - return sum; - } - - /** - * Computes the 2-norm of an array of doubles. - * - * @param doubles the array of double - * @return the 2-norm of the elements - */ - public static double norm(double[] doubles) { - - double sqSum = 0; - - for (int i = 0; i < doubles.length; i++) { - sqSum += doubles[i]*doubles[i]; - } - return Math.sqrt(sqSum); - } - - /** - * Computes the sum of the elements of an array of integers. - * - * @param ints the array of integers - * @return the sum of the elements - */ - public static int sum(int[] ints) { - - int sum = 0; - - for (int i = 0; i < ints.length; i++) { - sum += ints[i]; - } - return sum; - } - /** * Returns c*log2(c) for a given integer value c. *