public class WeightedEuclideanDistanceFunction extends WeightedLPNormDistanceFunction
NumberVectors.
Weighted Euclidean distance is defined as: \[ \text{Euclidean}_{\vec{w}}(\vec{x},\vec{y}) := \sqrt{\sum\nolimits_i w_i (x_i-y_i)^2} \]
| Modifier and Type | Class and Description |
|---|---|
static class |
WeightedEuclideanDistanceFunction.Parameterizer
Parameterization class.
|
weightsinvp, pWEIGHTS_ID| Constructor and Description |
|---|
WeightedEuclideanDistanceFunction(double[] weights)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
distance(NumberVector v1,
NumberVector v2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
double |
minDist(SpatialComparable mbr1,
SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this distance
function.
|
double |
norm(NumberVector v)
Compute the norm of object obj.
|
private double |
preDistance(NumberVector v1,
NumberVector v2,
int start,
int end) |
private double |
preDistanceMBR(SpatialComparable mbr1,
SpatialComparable mbr2,
int start,
int end) |
private double |
preDistanceVM(NumberVector v,
SpatialComparable mbr,
int start,
int end) |
private double |
preNorm(NumberVector v,
int start,
int end) |
private double |
preNormMBR(SpatialComparable mbr,
int start,
int end) |
equals, getInputTypeRestriction, hashCodegetP, isMetric, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitinstantiateisMetric, isSquared, isSymmetricinstantiatepublic WeightedEuclideanDistanceFunction(double[] weights)
weights - private double preDistance(NumberVector v1, NumberVector v2, int start, int end)
private double preDistanceVM(NumberVector v, SpatialComparable mbr, int start, int end)
private double preDistanceMBR(SpatialComparable mbr1, SpatialComparable mbr2, int start, int end)
private double preNorm(NumberVector v, int start, int end)
private double preNormMBR(SpatialComparable mbr, int start, int end)
public double distance(NumberVector v1, NumberVector v2)
PrimitiveDistanceFunctiondistance in interface NumberVectorDistanceFunction<NumberVector>distance in interface PrimitiveDistanceFunction<NumberVector>distance in class WeightedLPNormDistanceFunctionv1 - first DatabaseObjectv2 - second DatabaseObjectpublic double norm(NumberVector v)
Normnorm in interface Norm<NumberVector>norm in class WeightedLPNormDistanceFunctionv - Objectpublic double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDistanceFunctionminDist in interface SpatialPrimitiveDistanceFunction<NumberVector>minDist in class WeightedLPNormDistanceFunctionmbr1 - the first MBR objectmbr2 - the second MBR objectCopyright © 2019 ELKI Development Team. License information.