Mercurial > hg > jslab
comparison src/samer/mds/Manhatten.java @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:bf79fb79ee13 |
---|---|
1 package samer.mds; | |
2 | |
3 /** city block or manhatten metricc */ | |
4 | |
5 public class Manhatten implements MDS.Metric { | |
6 public double d(double [] x, double [] y, double [] r) { | |
7 double a=0; | |
8 for (int i=0; i<r.length; i++) { r[i]=y[i]-x[i]; a+=Math.abs(r[i]); } | |
9 return a; | |
10 } | |
11 } |