public class SparseSquaredEuclideanDistanceFunction extends java.lang.Object implements PrimitiveDistanceFunction<SparseNumberVector>, Norm<SparseNumberVector>
SparseNumberVectors.
Squared Euclidean distance is defined as: \[ \text{Euclidean}^2(\vec{x},\vec{y}) := \sum\nolimits_i (x_i-y_i)^2 \]
For sparse vectors, we can skip those i where both vectors are 0.
| Modifier and Type | Class and Description |
|---|---|
static class |
SparseSquaredEuclideanDistanceFunction.Parameterizer
Parameterizer
|
| Modifier and Type | Field and Description |
|---|---|
static SparseSquaredEuclideanDistanceFunction |
STATIC
Static instance
|
| Constructor and Description |
|---|
SparseSquaredEuclideanDistanceFunction()
Deprecated.
Use static instance instead.
|
| Modifier and Type | Method and Description |
|---|---|
double |
distance(SparseNumberVector v1,
SparseNumberVector v2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
SimpleTypeInformation<? super SparseNumberVector> |
getInputTypeRestriction()
Get the input data type of the function.
|
boolean |
isMetric()
Is this distance function metric (satisfy the triangle inequality)
|
boolean |
isSquared()
Squared distances, that would become metric after square root.
|
double |
norm(SparseNumberVector v1)
Compute the norm of object obj.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinstantiateisSymmetricpublic static final SparseSquaredEuclideanDistanceFunction STATIC
@Deprecated public SparseSquaredEuclideanDistanceFunction()
STATIC instead.public double distance(SparseNumberVector v1, SparseNumberVector v2)
PrimitiveDistanceFunctiondistance in interface PrimitiveDistanceFunction<SparseNumberVector>v1 - first DatabaseObjectv2 - second DatabaseObjectpublic double norm(SparseNumberVector v1)
Normnorm in interface Norm<SparseNumberVector>v1 - Objectpublic SimpleTypeInformation<? super SparseNumberVector> getInputTypeRestriction()
DistanceFunctiongetInputTypeRestriction in interface DistanceFunction<SparseNumberVector>getInputTypeRestriction in interface PrimitiveDistanceFunction<SparseNumberVector>public boolean isSquared()
DistanceFunctionisSquared in interface DistanceFunction<SparseNumberVector>true when squared.public boolean isMetric()
DistanceFunctionisMetric in interface DistanceFunction<SparseNumberVector>true when metric.Copyright © 2019 ELKI Development Team. License information.