@Test public void test1(){ double[] v1 = new double[]{8,3,7}; double[] v2 = new double[]{9,8,4}; double res = Ruzicka.distance(v1, v2); Asserts.assertEquals(res, 0.375); }
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);  }