@Test public void auto_test21(){ double[] v1 = new double[]{2.8498793447875945, 1.9543153242703482, 9.004152898158205, 5.179893607045418, 4.888202833407915, 2.5794598462671345, 0.4324138021194446, 5.445104756054463, 0.4429396198587765, 7.211735047609374}; double[] v2 = new double[]{9.387536162523187, 0.9323534185351967, 7.48090572879652, 2.218918373010206, 5.711928449374374, 8.171923867466468, 3.4954549295026416, 6.945450210635514, 2.977007791043884, 2.0460233906095593}; double res = L1.distance(v1, v2); double ref = 30.723197174182605; 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);  }