@Test public void getArgMax_Duplicates() { double [] testCase = new double[] {0.0, 1e10, -99999, 1e10, 1, 45, 1e10, 5, 354}; int expected = 6; int actual = Utility.getArgMax(testCase); Assert.assertEquals(expected, actual); }
public static int getArgMax(double[] array) { int argMax = 0; double max = -1e100; for(int i = 0; i < array.length; i++) { if(array[i] >= max) { argMax = i; max = array[i]; } } return argMax; }
Utility { public static int getArgMax(double[] array) { int argMax = 0; double max = -1e100; for(int i = 0; i < array.length; i++) { if(array[i] >= max) { argMax = i; max = array[i]; } } return argMax; } }
Utility { public static int getArgMax(double[] array) { int argMax = 0; double max = -1e100; for(int i = 0; i < array.length; i++) { if(array[i] >= max) { argMax = i; max = array[i]; } } return argMax; }  }
Utility { public static int getArgMax(double[] array) { int argMax = 0; double max = -1e100; for(int i = 0; i < array.length; i++) { if(array[i] >= max) { argMax = i; max = array[i]; } } return argMax; }  static int getArgMax(double[] array); static int booleansToInt(boolean [] booleans); static void intToBooleans(int intValue, boolean [] booleans); static String joinString(String [] list, String conjunction); }
Utility { public static int getArgMax(double[] array) { int argMax = 0; double max = -1e100; for(int i = 0; i < array.length; i++) { if(array[i] >= max) { argMax = i; max = array[i]; } } return argMax; }  static int getArgMax(double[] array); static int booleansToInt(boolean [] booleans); static void intToBooleans(int intValue, boolean [] booleans); static String joinString(String [] list, String conjunction);  }