public class ManhattanDistance extends DistanceFunction
Constructor and Description |
---|
ManhattanDistance()
Constructs a new Manhattan distance function.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(int length,
double[] position1,
double[] position2)
Calculates and returns the distance between the two positions.
|
distance
public ManhattanDistance()
public double distance(int length, double[] position1, double[] position2)
DistanceFunction
IllegalArgumentException
if any
preconditions fail.distance
in class DistanceFunction
length
- the length (or dimension) of the two positionsposition1
- the position of the first nodeposition2
- the position of the second nodeCopyright © 2016. All rights reserved.