public class ManhattanDistanceFunction extends LPNormDistanceFunction implements SpatialPrimitiveDoubleDistanceFunction<NumberVector<?>>
Modifier and Type | Class and Description |
---|---|
static class |
ManhattanDistanceFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
static ManhattanDistanceFunction |
STATIC
The static instance to use.
|
P_ID
Constructor and Description |
---|
ManhattanDistanceFunction()
Deprecated.
Use static instance!
|
Modifier and Type | Method and Description |
---|---|
double |
doubleDistance(NumberVector<?> v1,
NumberVector<?> v2)
Compute the Manhattan distance.
|
double |
doubleMinDist(SpatialComparable mbr1,
SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this
distance function.
|
private double |
doubleMinDistObject(SpatialComparable mbr,
NumberVector<?> v) |
double |
doubleNorm(NumberVector<?> v)
Returns the Manhattan norm of the given vector.
|
boolean |
equals(Object obj) |
boolean |
isMetric()
Is this distance function metric (in particular, does it satisfy the
triangle equation?)
|
String |
toString() |
getP, instantiate, minDist
norm
distance, getDistanceFactory, getInputTypeRestriction
isSymmetric
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
instantiate, minDist
distance, getInputTypeRestriction
getDistanceFactory, isSymmetric
public static final ManhattanDistanceFunction STATIC
@Deprecated public ManhattanDistanceFunction()
public double doubleDistance(NumberVector<?> v1, NumberVector<?> v2)
doubleDistance
in interface PrimitiveDoubleDistanceFunction<NumberVector<?>>
doubleDistance
in class LPNormDistanceFunction
v1
- first vectorv2
- second vectorpublic double doubleNorm(NumberVector<?> v)
doubleNorm
in interface DoubleNorm<NumberVector<?>>
doubleNorm
in class LPNormDistanceFunction
v
- the vector to compute the norm ofprivate double doubleMinDistObject(SpatialComparable mbr, NumberVector<?> v)
public double doubleMinDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDoubleDistanceFunction
doubleMinDist
in interface SpatialPrimitiveDoubleDistanceFunction<NumberVector<?>>
doubleMinDist
in class LPNormDistanceFunction
mbr1
- the first MBR objectmbr2
- the second MBR objectpublic boolean isMetric()
DistanceFunction
isMetric
in interface DistanceFunction<NumberVector<?>,DoubleDistance>
isMetric
in class LPNormDistanceFunction
true
when metric.public String toString()
toString
in class LPNormDistanceFunction
public boolean equals(Object obj)
equals
in class LPNormDistanceFunction