@Test public void auto_test20(){ double[] v1 = new double[]{630996, 45829, 407243, -856511, -286830, 335711, -766571, 188513, 322279, -832945}; double[] v2 = new double[]{769290, 732479, -352263, -489982, 780203, 835576, 294767, -216092, 388200, 425232}; double res = Ruzicka.distance(v1, v2); double ref = 1.0*6307918/4331521; Asserts.assertDistance(ref); Asserts.assertEquals(res, ref); }
public static double distance(double[] v1,double[] v2){ Asserts.assertEqualLength(v1, v2); double sumMin = 0; double sumMax = 0; for(int i=0;i<v1.length;i++){ sumMin += CommonStats.min(v1[i], v2[i]); sumMax += CommonStats.max(v1[i], v2[i]); } return 1 - (sumMin/sumMax); }
Ruzicka { public static double distance(double[] v1,double[] v2){ Asserts.assertEqualLength(v1, v2); double sumMin = 0; double sumMax = 0; for(int i=0;i<v1.length;i++){ sumMin += CommonStats.min(v1[i], v2[i]); sumMax += CommonStats.max(v1[i], v2[i]); } return 1 - (sumMin/sumMax); } }
Ruzicka { public static double distance(double[] v1,double[] v2){ Asserts.assertEqualLength(v1, v2); double sumMin = 0; double sumMax = 0; for(int i=0;i<v1.length;i++){ sumMin += CommonStats.min(v1[i], v2[i]); sumMax += CommonStats.max(v1[i], v2[i]); } return 1 - (sumMin/sumMax); }  }
Ruzicka { public static double distance(double[] v1,double[] v2){ Asserts.assertEqualLength(v1, v2); double sumMin = 0; double sumMax = 0; for(int i=0;i<v1.length;i++){ sumMin += CommonStats.min(v1[i], v2[i]); sumMax += CommonStats.max(v1[i], v2[i]); } return 1 - (sumMin/sumMax); }  static double distance(double[] v1,double[] v2); }
Ruzicka { public static double distance(double[] v1,double[] v2){ Asserts.assertEqualLength(v1, v2); double sumMin = 0; double sumMax = 0; for(int i=0;i<v1.length;i++){ sumMin += CommonStats.min(v1[i], v2[i]); sumMax += CommonStats.max(v1[i], v2[i]); } return 1 - (sumMin/sumMax); }  static double distance(double[] v1,double[] v2);  }