
public class DimensionSelectingDistanceFunction extends AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance> implements SpatialPrimitiveDoubleDistanceFunction<NumberVector<?,?>>
| Modifier and Type | Class and Description |
|---|---|
static class |
DimensionSelectingDistanceFunction.Parameterizer
Parameterization class.
|
| Modifier and Type | Field and Description |
|---|---|
private int |
dim
The dimension to be considered for distance computation.
|
static OptionID |
DIM_ID
Parameter for dimensionality.
|
| Constructor and Description |
|---|
DimensionSelectingDistanceFunction(int dim)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DoubleDistance |
distance(NumberVector<?,?> o1,
NumberVector<?,?> o2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
double |
doubleDistance(NumberVector<?,?> v1,
NumberVector<?,?> v2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
double |
doubleMinDist(SpatialComparable mbr1,
SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this
distance function.
|
boolean |
equals(Object obj) |
DoubleDistance |
getDistanceFactory()
Method to get the distance functions factory.
|
VectorTypeInformation<? super NumberVector<?,?>> |
getInputTypeRestriction()
Get the input data type of the function.
|
int |
getSelectedDimension()
Returns the selected dimension.
|
<T extends NumberVector<?,?>> |
instantiate(Relation<T> database)
Instantiate with a database to get the actual distance query.
|
DoubleDistance |
minDist(SpatialComparable mbr1,
SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this distance
function.
|
isMetric, isSymmetricclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisMetric, isSymmetricpublic static final OptionID DIM_ID
private int dim
public DimensionSelectingDistanceFunction(int dim)
dim - Dimensionpublic double doubleDistance(NumberVector<?,?> v1, NumberVector<?,?> v2)
doubleDistance in interface PrimitiveDoubleDistanceFunction<NumberVector<?,?>>v1 - first DatabaseObjectv2 - second DatabaseObjectpublic double doubleMinDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDoubleDistanceFunctiondoubleMinDist in interface SpatialPrimitiveDoubleDistanceFunction<NumberVector<?,?>>mbr1 - the first MBR objectmbr2 - the second MBR objectpublic DoubleDistance distance(NumberVector<?,?> o1, NumberVector<?,?> o2)
PrimitiveDistanceFunctiondistance in interface PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>distance in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>o1 - first DatabaseObjecto2 - second DatabaseObjectpublic DoubleDistance minDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDistanceFunctionminDist in interface SpatialPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>mbr1 - the first MBR objectmbr2 - the second MBR objectpublic int getSelectedDimension()
public VectorTypeInformation<? super NumberVector<?,?>> getInputTypeRestriction()
DistanceFunctiongetInputTypeRestriction in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>getInputTypeRestriction in interface PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>public DoubleDistance getDistanceFactory()
DistanceFunctiongetDistanceFactory in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>getDistanceFactory in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>public <T extends NumberVector<?,?>> SpatialPrimitiveDistanceQuery<T,DoubleDistance> instantiate(Relation<T> database)
AbstractPrimitiveDistanceFunctioninstantiate in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>instantiate in interface SpatialPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>instantiate in class AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>database - Representation