@Test public void auto_test30(){ double[] v1 = new double[]{-9.08867422366639, -2.447013952084338, 3.5409985381917086, -8.448665167685196, -3.8469698760718343, -0.09439608693416868, -2.5907812266647956, -0.20860764284608369, -2.177903128602501, 7.707278354605265}; double[] v2 = new double[]{-5.449297336919173, -8.83266137046016, -0.8129782220940052, -4.119595441814817, -1.7457011397005362, 6.774481469346978, -2.3100432173528995, -7.187227966699137, 4.628596517901903, -7.8234955294128135}; double res = L1.distance(v1, v2); double ref = 57.274848947619006; 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);  }