Package elki.distance
Class ClarkDistance
- java.lang.Object
-
- elki.distance.ClarkDistance
-
- All Implemented Interfaces:
Distance<NumberVector>,NumberVectorDistance<NumberVector>,PrimitiveDistance<NumberVector>,SpatialPrimitiveDistance<NumberVector>
@Priority(200) @Reference(authors="M.-M. Deza, E. Deza", title="Dictionary of distances", booktitle="Dictionary of distances", url="https://doi.org/10.1007/978-3-642-00234-2", bibkey="doi:10.1007/978-3-642-00234-2") public class ClarkDistance extends java.lang.Object implements SpatialPrimitiveDistance<NumberVector>, NumberVectorDistance<NumberVector>
Clark distance function for vector spaces.Clark distance is defined as: \[ \text{Clark}(\vec{x},\vec{y}) := \sqrt{\tfrac{1}{d}\sum\nolimits_i \left(\tfrac{|x_i-y_i|}{|x_i|+|y_i|}\right)^2} \]
Reference:
M.-M. Deza, E. Deza
Dictionary of distances- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClarkDistance.ParParameterization class.
-
Field Summary
Fields Modifier and Type Field Description static ClarkDistanceSTATICStatic instance.
-
Constructor Summary
Constructors Constructor Description ClarkDistance()Deprecated.UseSTATICinstance instead.
-
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.booleanequals(java.lang.Object obj)SimpleTypeInformation<? super NumberVector>getInputTypeRestriction()Get the input data type of the function.inthashCode()doubleminDist(SpatialComparable mbr1, SpatialComparable mbr2)Computes the distance between the two given MBRs according to this distance function.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isMetric, isSquared, isSymmetric
-
Methods inherited from interface elki.distance.SpatialPrimitiveDistance
instantiate
-
-
-
-
Field Detail
-
STATIC
public static final ClarkDistance STATIC
Static instance.
-
-
Constructor Detail
-
ClarkDistance
@Deprecated public ClarkDistance()
Deprecated.UseSTATICinstance instead.Constructor.
-
-
Method Detail
-
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>- Parameters:
v1- first DatabaseObjectv2- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
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>- Parameters:
mbr1- the first MBR objectmbr2- the second MBR object- Returns:
- the distance between the two given MBRs according to this distance function
-
getInputTypeRestriction
public SimpleTypeInformation<? super NumberVector> getInputTypeRestriction()
Description copied from interface:DistanceGet the input data type of the function.- Specified by:
getInputTypeRestrictionin interfaceDistance<NumberVector>- Specified by:
getInputTypeRestrictionin interfacePrimitiveDistance<NumberVector>- Returns:
- Type restriction
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-