|
@@ -176,7 +176,7 @@ double calculate_manhattan_similarity(struct ngbr_stats *Ri,
|
|
|
|
|
|
/* squared manhattan distance, sum the differences for each dimension */
|
|
/* squared manhattan distance, sum the differences for each dimension */
|
|
do {
|
|
do {
|
|
- val += Ri->mean[n] - Rk->mean[n];
|
|
|
|
|
|
+ val += fabs(Ri->mean[n] - Rk->mean[n]);
|
|
} while (n--);
|
|
} while (n--);
|
|
|
|
|
|
/* the return value should always be in the range 0 - 1 */
|
|
/* the return value should always be in the range 0 - 1 */
|