@Test public void test5(){ HashSet<Integer> h1 = new HashSet<Integer>(); HashSet<Integer> h2 = new HashSet<Integer>(); h1.add(new Integer(0)); h1.add(new Integer(1)); h1.add(new Integer(-3)); h2.add(new Integer(1)); h2.add(new Integer(7)); h2.add(new Integer(100)); SHashSetInt s1 = new SHashSetInt(h1); SHashSetInt s2 = new SHashSetInt(h2); double res = Tanimoto.distance(s1, s2); Asserts.assertEquals(res, 0.8); }
public static double distance(Set s1,Set s2){ return 1-(double)s1.intersect(s2).size()/(double)s1.union(s2).size(); }
Tanimoto { public static double distance(Set s1,Set s2){ return 1-(double)s1.intersect(s2).size()/(double)s1.union(s2).size(); } }
Tanimoto { public static double distance(Set s1,Set s2){ return 1-(double)s1.intersect(s2).size()/(double)s1.union(s2).size(); }  }
Tanimoto { public static double distance(Set s1,Set s2){ return 1-(double)s1.intersect(s2).size()/(double)s1.union(s2).size(); }  static double distance(Set s1,Set s2); }
Tanimoto { public static double distance(Set s1,Set s2){ return 1-(double)s1.intersect(s2).size()/(double)s1.union(s2).size(); }  static double distance(Set s1,Set s2);  }