@Test public void test2(){ int[] v1 = new int[]{1,1,1,1}; int[] v2 = new int[]{0,1,0,0}; Asserts.assertEqualLength(v1, v2); double res = Dice.distance(v1, v2); Asserts.assertEquals(res, 0.375); }
public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); Asserts.assertIsBinary(v1); Asserts.assertIsBinary(v2); Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return (Simpson.distance(v1, v2) + BraunBlanquet.distance(v1, v2))/2; }
Dice { public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); Asserts.assertIsBinary(v1); Asserts.assertIsBinary(v2); Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return (Simpson.distance(v1, v2) + BraunBlanquet.distance(v1, v2))/2; } }
Dice { public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); Asserts.assertIsBinary(v1); Asserts.assertIsBinary(v2); Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return (Simpson.distance(v1, v2) + BraunBlanquet.distance(v1, v2))/2; }  }
Dice { public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); Asserts.assertIsBinary(v1); Asserts.assertIsBinary(v2); Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return (Simpson.distance(v1, v2) + BraunBlanquet.distance(v1, v2))/2; }  static double distance(int[] v1, int[] v2); }
Dice { public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); Asserts.assertIsBinary(v1); Asserts.assertIsBinary(v2); Asserts.assertHasAllZeros(v1); Asserts.assertHasAllZeros(v2); return (Simpson.distance(v1, v2) + BraunBlanquet.distance(v1, v2))/2; }  static double distance(int[] v1, int[] v2);  }