@@ -25,12 +25,12 @@ private static boolean[] conv(String bits) {
25
25
@ Test public void testDissimilarityExplicit () {
26
26
boolean [] f1 = conv ("10101" );
27
27
boolean [] s1 = conv ("10101" );
28
- assertEquals ("0" , P2J10 .matchingDissimilarity (f1 , s1 ).toString ());
29
- assertEquals ("0" , P2J10 .jaccardDissimilarity (f1 , s1 ).toString ());
30
- assertEquals ("0" , P2J10 .diceDissimilarity (f1 , s1 ).toString ());
31
- assertEquals ("0" , P2J10 .rogersTanimonoDissimilarity (f1 , s1 ).toString ());
28
+ assertEquals (new Fraction ( 0 ). toString () , P2J10 .matchingDissimilarity (f1 , s1 ).toString ());
29
+ assertEquals (new Fraction ( 0 ). toString () , P2J10 .jaccardDissimilarity (f1 , s1 ).toString ());
30
+ assertEquals (new Fraction ( 0 ). toString () , P2J10 .diceDissimilarity (f1 , s1 ).toString ());
31
+ assertEquals (new Fraction ( 0 ). toString () , P2J10 .rogersTanimonoDissimilarity (f1 , s1 ).toString ());
32
32
assertEquals ("2/5" , P2J10 .russellRaoDissimilarity (f1 , s1 ).toString ());
33
- assertEquals ("0" , P2J10 .sokalSneathDissimilarity (f1 , s1 ).toString ());
33
+ assertEquals (new Fraction ( 0 ). toString () , P2J10 .sokalSneathDissimilarity (f1 , s1 ).toString ());
34
34
35
35
boolean [] f2 = conv ("01111" );
36
36
boolean [] s2 = conv ("00100" );
@@ -79,12 +79,12 @@ private static boolean[] conv(String bits) {
79
79
80
80
boolean [] f7 = conv ("01101" );
81
81
boolean [] s7 = conv ("10010" );
82
- assertEquals ("1" , P2J10 .matchingDissimilarity (f7 , s7 ).toString ());
83
- assertEquals ("1" , P2J10 .jaccardDissimilarity (f7 , s7 ).toString ());
84
- assertEquals ("1" , P2J10 .diceDissimilarity (f7 , s7 ).toString ());
85
- assertEquals ("1" , P2J10 .rogersTanimonoDissimilarity (f7 , s7 ).toString ());
86
- assertEquals ("1" , P2J10 .russellRaoDissimilarity (f7 , s7 ).toString ());
87
- assertEquals ("1" , P2J10 .sokalSneathDissimilarity (f7 , s7 ).toString ());
82
+ assertEquals (new Fraction ( 1 ). toString () , P2J10 .matchingDissimilarity (f7 , s7 ).toString ());
83
+ assertEquals (new Fraction ( 1 ). toString () , P2J10 .jaccardDissimilarity (f7 , s7 ).toString ());
84
+ assertEquals (new Fraction ( 1 ). toString () , P2J10 .diceDissimilarity (f7 , s7 ).toString ());
85
+ assertEquals (new Fraction ( 1 ). toString () , P2J10 .rogersTanimonoDissimilarity (f7 , s7 ).toString ());
86
+ assertEquals (new Fraction ( 1 ). toString () , P2J10 .russellRaoDissimilarity (f7 , s7 ).toString ());
87
+ assertEquals (new Fraction ( 1 ). toString () , P2J10 .sokalSneathDissimilarity (f7 , s7 ).toString ());
88
88
}
89
89
90
90
private static final int N = 1000 ;
0 commit comments