Package elki.distance.minkowski
Class WeightedMaximumDistance
- java.lang.Object
-
- elki.distance.minkowski.LPNormDistance
-
- elki.distance.minkowski.WeightedLPNormDistance
-
- elki.distance.minkowski.WeightedMaximumDistance
-
- All Implemented Interfaces:
Distance<NumberVector>,Norm<NumberVector>,NumberVectorDistance<NumberVector>,PrimitiveDistance<NumberVector>,SpatialPrimitiveDistance<NumberVector>,WeightedNumberVectorDistance<NumberVector>
public class WeightedMaximumDistance extends WeightedLPNormDistance
Weighted version of the maximum distance function forNumberVectors.Weighted maximum distance is defined as: \[ \text{Maximum}_{\vec{w}}(\vec{x},\vec{y}) := \max_i w_i |x_i-y_i| \]
- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWeightedMaximumDistance.ParParameterization class.
-
Field Summary
-
Fields inherited from class elki.distance.minkowski.WeightedLPNormDistance
weights
-
Fields inherited from class elki.distance.minkowski.LPNormDistance
invp, p
-
Fields inherited from interface elki.distance.WeightedNumberVectorDistance
WEIGHTS_ID
-
-
Constructor Summary
Constructors Constructor Description WeightedMaximumDistance(double[] weights)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledistance(NumberVector v1, NumberVector v2)Computes the distance between two given DatabaseObjects according to this distance function.doubleminDist(SpatialComparable mbr1, SpatialComparable mbr2)Computes the distance between the two given MBRs according to this distance function.doublenorm(NumberVector v)Compute the norm of object obj.private doublepreDistance(NumberVector v1, NumberVector v2, int start, int end)private doublepreDistanceMBR(SpatialComparable mbr1, SpatialComparable mbr2, int start, int end)private doublepreDistanceVM(NumberVector v, SpatialComparable mbr, int start, int end)private doublepreNorm(NumberVector v, int start, int end)private doublepreNormMBR(SpatialComparable mbr, int start, int end)-
Methods inherited from class elki.distance.minkowski.WeightedLPNormDistance
equals, getInputTypeRestriction, hashCode
-
Methods inherited from class elki.distance.minkowski.LPNormDistance
getInvP, getP, isMetric, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isMetric, isSquared, isSymmetric
-
Methods inherited from interface elki.distance.SpatialPrimitiveDistance
instantiate
-
-
-
-
Method Detail
-
preDistance
private double preDistance(NumberVector v1, NumberVector v2, int start, int end)
-
preDistanceVM
private double preDistanceVM(NumberVector v, SpatialComparable mbr, int start, int end)
-
preDistanceMBR
private double preDistanceMBR(SpatialComparable mbr1, SpatialComparable mbr2, int start, int end)
-
preNorm
private double preNorm(NumberVector v, int start, int end)
-
preNormMBR
private double preNormMBR(SpatialComparable mbr, int start, int end)
-
distance
public double distance(NumberVector v1, NumberVector v2)
Description copied from interface:PrimitiveDistanceComputes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distancein interfaceNumberVectorDistance<NumberVector>- Specified by:
distancein interfacePrimitiveDistance<NumberVector>- Overrides:
distancein classWeightedLPNormDistance- Parameters:
v1- first DatabaseObjectv2- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
norm
public double norm(NumberVector v)
Description copied from interface:NormCompute the norm of object obj.- Specified by:
normin interfaceNorm<NumberVector>- Overrides:
normin classWeightedLPNormDistance- Parameters:
v- Object- Returns:
- Norm
-
minDist
public double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
Description copied from interface:SpatialPrimitiveDistanceComputes the distance between the two given MBRs according to this distance function.- Specified by:
minDistin interfaceSpatialPrimitiveDistance<NumberVector>- Overrides:
minDistin classWeightedLPNormDistance- Parameters:
mbr1- the first MBR objectmbr2- the second MBR object- Returns:
- the distance between the two given MBRs according to this distance function
-
-