Package elki.distance.subspace
Class SubspaceEuclideanDistance
- java.lang.Object
-
- elki.distance.subspace.AbstractDimensionsSelectingDistance<NumberVector>
-
- elki.distance.subspace.SubspaceLPNormDistance
-
- elki.distance.subspace.SubspaceEuclideanDistance
-
- All Implemented Interfaces:
Distance<NumberVector>
,Norm<NumberVector>
,NumberVectorDistance<NumberVector>
,PrimitiveDistance<NumberVector>
,SpatialPrimitiveDistance<NumberVector>
,DimensionSelectingSubspaceDistance<NumberVector>
public class SubspaceEuclideanDistance extends SubspaceLPNormDistance
Euclidean distance function betweenNumberVector
s only in specified dimensions.- Since:
- 0.1
- Author:
- Elke Achtert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SubspaceEuclideanDistance.Par
Parameterization class.
-
Field Summary
-
Fields inherited from class elki.distance.subspace.AbstractDimensionsSelectingDistance
dimensions
-
-
Constructor Summary
Constructors Constructor Description SubspaceEuclideanDistance(long[] dimensions)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(NumberVector v1, NumberVector v2)
Constructor.boolean
equals(java.lang.Object obj)
int
hashCode()
double
minDist(SpatialComparable mbr1, SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this distance function.protected double
minDistObject(SpatialComparable mbr, NumberVector v)
double
norm(NumberVector obj)
Compute the norm of object obj.-
Methods inherited from class elki.distance.subspace.SubspaceLPNormDistance
getInputTypeRestriction, getP, instantiate, isMetric
-
Methods inherited from class elki.distance.subspace.AbstractDimensionsSelectingDistance
getSelectedDimensions, setSelectedDimensions
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isSquared, isSymmetric
-
-
-
-
Method Detail
-
distance
public double distance(NumberVector v1, NumberVector v2)
Constructor.- Specified by:
distance
in interfaceNumberVectorDistance<NumberVector>
- Specified by:
distance
in interfacePrimitiveDistance<NumberVector>
- Overrides:
distance
in classSubspaceLPNormDistance
- Parameters:
v1
- first feature vectorv2
- second feature vector- Returns:
- the Euclidean distance between two given feature vectors in the selected dimensions
-
minDistObject
protected double minDistObject(SpatialComparable mbr, NumberVector v)
- Overrides:
minDistObject
in classSubspaceLPNormDistance
-
minDist
public double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
Description copied from interface:SpatialPrimitiveDistance
Computes the distance between the two given MBRs according to this distance function.- Specified by:
minDist
in interfaceSpatialPrimitiveDistance<NumberVector>
- Overrides:
minDist
in classSubspaceLPNormDistance
- Parameters:
mbr1
- the first MBR objectmbr2
- the second MBR object- Returns:
- the distance between the two given MBRs according to this distance function
-
norm
public double norm(NumberVector obj)
Description copied from interface:Norm
Compute the norm of object obj.- Specified by:
norm
in interfaceNorm<NumberVector>
- Overrides:
norm
in classSubspaceLPNormDistance
- Parameters:
obj
- Object- Returns:
- Norm
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classSubspaceLPNormDistance
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classSubspaceLPNormDistance
-
-