static int computeManhattan ( IntTuple t0 , IntTuple t1 ) { Utils . checkForEqualSize ( t0 , t1 ) ; int sum = 0 ; for ( int i = 0 ; i < t0 . getSize ( ) ; i ++ ) { int d = t0 . get ( i ) - t1 . get ( i ) ; sum += Math . abs ( d ) ; } return sum ; }
Computes the Manhattan distance between the given tuples