@Test public void testMax() throws Exception { Assert.assertEquals(0, ArrayMath.max(new double[] {0}), 0); Assert.assertEquals(0, ArrayMath.max(new double[] {0, 0, 0}), 0); Assert.assertEquals(2, ArrayMath.max(new double[] {0, 1, 2}), 0); Assert.assertEquals(200, ArrayMath.max(new double[] {100, 200, 2}), 0); Assert.assertEquals(300, ArrayMath.max(new double[] {100, 200, 300, -10, -20}), 0); }
public static double max(double[] x) { int maxIdx = argmax(x); return x[maxIdx]; }
ArrayMath { public static double max(double[] x) { int maxIdx = argmax(x); return x[maxIdx]; } }
ArrayMath { public static double max(double[] x) { int maxIdx = argmax(x); return x[maxIdx]; }  }
ArrayMath { public static double max(double[] x) { int maxIdx = argmax(x); return x[maxIdx]; }  static double innerProduct(double[] vecA, double[] vecB); static double l1norm(double[] v); static double l2norm(double[] v); static double invL2norm(double[] v); static double logSumOfExps(double[] x); static double max(double[] x); static int argmax(double[] x); static void sumFeatures(Context[] context, float[] values, double[] prior); static double[] toDoubleArray(List<Double> list); static int[] toIntArray(List<Integer> list); }
ArrayMath { public static double max(double[] x) { int maxIdx = argmax(x); return x[maxIdx]; }  static double innerProduct(double[] vecA, double[] vecB); static double l1norm(double[] v); static double l2norm(double[] v); static double invL2norm(double[] v); static double logSumOfExps(double[] x); static double max(double[] x); static int argmax(double[] x); static void sumFeatures(Context[] context, float[] values, double[] prior); static double[] toDoubleArray(List<Double> list); static int[] toIntArray(List<Integer> list);  }