Package elki.distance
Class AbstractNumberVectorDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- All Implemented Interfaces:
Distance<NumberVector>
,NumberVectorDistance<NumberVector>
,PrimitiveDistance<NumberVector>
- Direct Known Subclasses:
AbsolutePearsonCorrelationDistance
,AbsoluteUncenteredCorrelationDistance
,AbstractEditDistance
,BrayCurtisDistance
,ChiSquaredDistance
,FisherRaoDistance
,HellingerDistance
,HistogramIntersectionDistance
,HistogramMatchDistance
,JeffreyDivergenceDistance
,KolmogorovSmirnovDistance
,Kulczynski1Similarity
,KullbackLeiblerDivergenceAsymmetricDistance
,KullbackLeiblerDivergenceReverseAsymmetricDistance
,LCSSDistance
,MatrixWeightedQuadraticDistance
,MinimumDistance
,MultiLPNorm
,OnedimensionalDistance
,PearsonCorrelationDistance
,SquaredEuclideanDistance
,SquaredPearsonCorrelationDistance
,SquaredUncenteredCorrelationDistance
,TriangularDiscriminationDistance
,TutorialDistance
,UncenteredCorrelationDistance
,WeightedCanberraDistance
,WeightedPearsonCorrelationDistance
,WeightedSquaredEuclideanDistance
,WeightedSquaredPearsonCorrelationDistance
public abstract class AbstractNumberVectorDistance extends java.lang.Object implements NumberVectorDistance<NumberVector>
Abstract base class for the most common family of distance functions: defined on number vectors and returning double values.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description AbstractNumberVectorDistance()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
dimensionality(double[] o1, double[] o2)
Get the common dimensionality of the two objects.static int
dimensionality(double[] o1, double[] o2, int expect)
Get the common dimensionality of the two objects.static int
dimensionality(double[] o1, SpatialComparable o2)
Get the common dimensionality of the two objects.static int
dimensionality(double[] o1, SpatialComparable o2, int expect)
Get the common dimensionality of the two objects.static int
dimensionality(NumberVector o1, NumberVector o2)
Get the common dimensionality of the two objects.static int
dimensionality(NumberVector o1, NumberVector o2, int expect)
Get the common dimensionality of the two objects.static int
dimensionality(SpatialComparable o1, SpatialComparable o2)
Get the common dimensionality of the two objects.static int
dimensionality(SpatialComparable o1, SpatialComparable o2, int expect)
Get the common dimensionality of the two objects.SimpleTypeInformation<? super NumberVector>
getInputTypeRestriction()
Get the input data type of the function.-
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
isMetric, isSquared, isSymmetric
-
Methods inherited from interface elki.distance.NumberVectorDistance
distance
-
Methods inherited from interface elki.distance.PrimitiveDistance
distance, instantiate
-
-
-
-
Method Detail
-
getInputTypeRestriction
public SimpleTypeInformation<? super NumberVector> getInputTypeRestriction()
Description copied from interface:Distance
Get the input data type of the function.- Specified by:
getInputTypeRestriction
in interfaceDistance<NumberVector>
- Specified by:
getInputTypeRestriction
in interfacePrimitiveDistance<NumberVector>
- Returns:
- Type restriction
-
dimensionality
public static final int dimensionality(SpatialComparable o1, SpatialComparable o2)
Get the common dimensionality of the two objects. Throw anIllegalArgumentException
otherwise.- Parameters:
o1
- First vector / MBRo2
- Second vector / MBR- Returns:
- Common dimensionality
- Throws:
java.lang.IllegalArgumentException
- when dimensionalities are not the same.
-
dimensionality
public static final int dimensionality(double[] o1, SpatialComparable o2)
Get the common dimensionality of the two objects. Throw anIllegalArgumentException
otherwise.- Parameters:
o1
- First vector / MBRo2
- Second vector / MBR- Returns:
- Common dimensionality
- Throws:
java.lang.IllegalArgumentException
- when dimensionalities are not the same.
-
dimensionality
public static final int dimensionality(double[] o1, double[] o2)
Get the common dimensionality of the two objects. Throw anIllegalArgumentException
otherwise.- Parameters:
o1
- First vector / MBRo2
- Second vector / MBR- Returns:
- Common dimensionality
- Throws:
java.lang.IllegalArgumentException
- when dimensionalities are not the same.
-
dimensionality
public static final int dimensionality(SpatialComparable o1, SpatialComparable o2, int expect)
Get the common dimensionality of the two objects. Throw anIllegalArgumentException
otherwise.- Parameters:
o1
- First vector / MBRo2
- Second vector / MBRexpect
- Expected dimensionality- Returns:
- Common dimensionality
- Throws:
java.lang.IllegalArgumentException
- when dimensionalities are not the same.
-
dimensionality
public static final int dimensionality(double[] o1, SpatialComparable o2, int expect)
Get the common dimensionality of the two objects. Throw anIllegalArgumentException
otherwise.- Parameters:
o1
- First vector / MBRo2
- Second vector / MBRexpect
- Expected dimensionality- Returns:
- Common dimensionality
- Throws:
java.lang.IllegalArgumentException
- when dimensionalities are not the same.
-
dimensionality
public static final int dimensionality(double[] o1, double[] o2, int expect)
Get the common dimensionality of the two objects. Throw anIllegalArgumentException
otherwise.- Parameters:
o1
- First vector / MBRo2
- Second vector / MBRexpect
- Expected dimensionality- Returns:
- Common dimensionality
- Throws:
java.lang.IllegalArgumentException
- when dimensionalities are not the same.
-
dimensionality
public static final int dimensionality(NumberVector o1, NumberVector o2)
Get the common dimensionality of the two objects. Throw anIllegalArgumentException
otherwise.- Parameters:
o1
- First vector / MBRo2
- Second vector / MBR- Returns:
- Common dimensionality
- Throws:
java.lang.IllegalArgumentException
- when dimensionalities are not the same.
-
dimensionality
public static final int dimensionality(NumberVector o1, NumberVector o2, int expect)
Get the common dimensionality of the two objects. Throw anIllegalArgumentException
otherwise.- Parameters:
o1
- First vector / MBRo2
- Second vector / MBRexpect
- Expected dimensionality- Returns:
- Common dimensionality
- Throws:
java.lang.IllegalArgumentException
- when dimensionalities are not the same.
-
-