@Test public void auto_test5(){ double[] v1 = new double[]{2, 5, 5, 5, 1, 8, 3, 4, 4, 5}; double[] v2 = new double[]{2, 1, 1, 4, 1, 7, 4, 6, 1, 0}; double res = L1.distance(v1, v2); double ref = 21; Asserts.assertDistance(ref); Asserts.assertEquals(res, ref); }
public static double distance(double[] v1, double[] v2){ Asserts.assertEqualLength(v1, v2); double res = 0; int i = 0; while(i < v1.length){ double t = CommonStats.abs(v1[i] - v2[i]); res += t; i++; } Asserts.assertDistance(res); return res; }
L1 { public static double distance(double[] v1, double[] v2){ Asserts.assertEqualLength(v1, v2); double res = 0; int i = 0; while(i < v1.length){ double t = CommonStats.abs(v1[i] - v2[i]); res += t; i++; } Asserts.assertDistance(res); return res; } }
L1 { public static double distance(double[] v1, double[] v2){ Asserts.assertEqualLength(v1, v2); double res = 0; int i = 0; while(i < v1.length){ double t = CommonStats.abs(v1[i] - v2[i]); res += t; i++; } Asserts.assertDistance(res); return res; }  }
L1 { public static double distance(double[] v1, double[] v2){ Asserts.assertEqualLength(v1, v2); double res = 0; int i = 0; while(i < v1.length){ double t = CommonStats.abs(v1[i] - v2[i]); res += t; i++; } Asserts.assertDistance(res); return res; }  static double distance(double[] v1, double[] v2); }
L1 { public static double distance(double[] v1, double[] v2){ Asserts.assertEqualLength(v1, v2); double res = 0; int i = 0; while(i < v1.length){ double t = CommonStats.abs(v1[i] - v2[i]); res += t; i++; } Asserts.assertDistance(res); return res; }  static double distance(double[] v1, double[] v2);  }