|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmath.RectilinearMetric
public class RectilinearMetric
The rectilinear metric (i.e., the sum of the absolute values of the differences between the elements). This is sometimes also called the Manhattan metric (because it is the distance you have to walk between two points in a city that is layed out on a grid).
Constructor Summary | |
---|---|
RectilinearMetric()
|
Method Summary | |
---|---|
double |
distance(double[] x,
double[] y)
Calculate the distance between two n-dimensional points (required by Metric) Note: For simplicity, this method does not confirm that the two arrays are the same size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RectilinearMetric()
Method Detail |
---|
public double distance(double[] x, double[] y)
distance
in interface Metric
x
- One n-dimensional pointy
- Another n-dimensional point
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |