@Test(expected = IllegalArgumentException.class) public void testArgmaxException1() throws Exception { ArrayMath.argmax(null); }
public static int argmax(double[] x) { if (x == null || x.length == 0) { throw new IllegalArgumentException("Vector x is null or empty"); } int maxIdx = 0; for (int i = 1; i < x.length; i++) { if (x[maxIdx] < x[i]) maxIdx = i; } return maxIdx; }
ArrayMath { public static int argmax(double[] x) { if (x == null || x.length == 0) { throw new IllegalArgumentException("Vector x is null or empty"); } int maxIdx = 0; for (int i = 1; i < x.length; i++) { if (x[maxIdx] < x[i]) maxIdx = i; } return maxIdx; } }
ArrayMath { public static int argmax(double[] x) { if (x == null || x.length == 0) { throw new IllegalArgumentException("Vector x is null or empty"); } int maxIdx = 0; for (int i = 1; i < x.length; i++) { if (x[maxIdx] < x[i]) maxIdx = i; } return maxIdx; }  }
ArrayMath { public static int argmax(double[] x) { if (x == null || x.length == 0) { throw new IllegalArgumentException("Vector x is null or empty"); } int maxIdx = 0; for (int i = 1; i < x.length; i++) { if (x[maxIdx] < x[i]) maxIdx = i; } return 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 int argmax(double[] x) { if (x == null || x.length == 0) { throw new IllegalArgumentException("Vector x is null or empty"); } int maxIdx = 0; for (int i = 1; i < x.length; i++) { if (x[maxIdx] < x[i]) maxIdx = i; } return 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);  }