Package elki.distance.minkowski
Class SparseManhattanDistance
- java.lang.Object
-
- elki.distance.minkowski.SparseLPNormDistance
-
- elki.distance.minkowski.SparseManhattanDistance
-
- All Implemented Interfaces:
Distance<SparseNumberVector>
,Norm<SparseNumberVector>
,PrimitiveDistance<SparseNumberVector>
public class SparseManhattanDistance extends SparseLPNormDistance
Manhattan distance, optimized forSparseNumberVector
s. Manhattan distance is defined as: \[ \text{Manhattan}(\vec{x},\vec{y}) := \sum_i |x_i-y_i| \]- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SparseManhattanDistance.Par
Parameterizer
-
Field Summary
Fields Modifier and Type Field Description static SparseManhattanDistance
STATIC
Static instance
-
Constructor Summary
Constructors Constructor Description SparseManhattanDistance()
Deprecated.Use static instance instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(SparseNumberVector v1, SparseNumberVector v2)
Computes the distance between two given DatabaseObjects according to this distance function.double
norm(SparseNumberVector v1)
Compute the norm of object obj.-
Methods inherited from class elki.distance.minkowski.SparseLPNormDistance
getInputTypeRestriction, isMetric
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isSquared, isSymmetric
-
Methods inherited from interface elki.distance.PrimitiveDistance
instantiate
-
-
-
-
Field Detail
-
STATIC
public static final SparseManhattanDistance STATIC
Static instance
-
-
Constructor Detail
-
SparseManhattanDistance
@Deprecated public SparseManhattanDistance()
Deprecated.Use static instance instead.Constructor - useSTATIC
instead.
-
-
Method Detail
-
distance
public double distance(SparseNumberVector v1, SparseNumberVector v2)
Description copied from interface:PrimitiveDistance
Computes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distance
in interfacePrimitiveDistance<SparseNumberVector>
- Overrides:
distance
in classSparseLPNormDistance
- Parameters:
v1
- first DatabaseObjectv2
- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
norm
public double norm(SparseNumberVector v1)
Description copied from interface:Norm
Compute the norm of object obj.- Specified by:
norm
in interfaceNorm<SparseNumberVector>
- Overrides:
norm
in classSparseLPNormDistance
- Parameters:
v1
- Object- Returns:
- Norm
-
-