|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.aitools.aq.algebra.vector.functions.ManhattanDistance
public final class ManhattanDistance
A Distance
measure for Vector
s.
The Manhattan Distance of two points is defined as the sum of the
lengths of the projections of the segment between them onto the
coordinate system axis. In the vector application, for each vector the
point is taken that would be the position of a point translated from the
origin by the vector.
It is calculated as the sum of the
absolute differences of each coordinate of the vectors.
If one vector is of a lower dimension (range) than the other vector,
the missing dimensions of the vector will be treated as zero.
The Proximity
of two vectors is computed as the negative similarity.
The normalized proximity is one minus the distance divided by the highest
double value (Double.MAX_VALUE). And it is 0 if the distance would
be infinite.
Constructor Summary | |
---|---|
ManhattanDistance()
Construct a new ManhattanDistance . |
Method Summary | |
---|---|
double |
computeDistance(Vector v1,
Vector v2)
Compute a kind of distance between two objects. |
double |
computeNormalizedProximity(Vector v1,
Vector v2)
Compute a kind of proximity between two objects. The value returned by this method has to be between 0 (meaning they are as far away (according to the proximity measure) from each other as possible) and 1 (identical objects according to the proximity measure). |
double |
computeProximity(Vector v1,
Vector v2)
Compute a kind of proximity between two objects. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ManhattanDistance()
ManhattanDistance
.
Method Detail |
---|
public double computeDistance(Vector v1, Vector v2)
Distance
computeDistance
in interface Distance<Vector>
v1
- One object, to be compared to the...v2
- ...second object
public double computeProximity(Vector v1, Vector v2)
Proximity
computeProximity
in interface Proximity<Vector>
v1
- One object, to be compared to the...v2
- ...second object
public double computeNormalizedProximity(Vector v1, Vector v2)
Proximity
computeNormalizedProximity
in interface Proximity<Vector>
v1
- One object, to be compared to the...v2
- ...second object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |