git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/stigmata/trunk@170
acee48c3-7b26-0410-bdac-
b3d0e5314bbc
*/\r
public double calculateSimilarity(){\r
double similarity = 0d;\r
+ int count = 0;\r
for(ComparisonPairElement elem: this){\r
- similarity += elem.getSimilarity();\r
+ double sim = elem.getSimilarity();\r
+ if(!Double.isNaN(sim) && !Double.isInfinite(sim)){\r
+ similarity += sim;\r
+ count++;\r
+ }\r
}\r
- return similarity / getBirthmarksCount();\r
+ return similarity / count;\r
}\r
\r
/**\r