public class DimensionSelectingDistanceFunction extends AbstractSpatialDoubleDistanceNorm implements DimensionSelectingSubspaceDistanceFunction<NumberVector<?>,DoubleDistance>
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 |
---|---|
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.
|
double |
doubleNorm(NumberVector<?> obj)
Compute the norm of object obj as double value.
|
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.
|
BitSet |
getSelectedDimensions()
Deprecated.
|
void |
setSelectedDimensions(BitSet dimensions)
Sets the selected dimensions according to the set bits in the given BitSet.
|
instantiate, minDist
norm
dimensionality, dimensionality, dimensionality, dimensionality, distance
isMetric, isSymmetric
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
instantiate, isMetric, isSymmetric
distance
public 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)
SpatialPrimitiveDoubleDistanceFunction
doubleMinDist
in interface SpatialPrimitiveDoubleDistanceFunction<NumberVector<?>>
mbr1
- the first MBR objectmbr2
- the second MBR objectpublic double doubleNorm(NumberVector<?> obj)
DoubleNorm
doubleNorm
in interface DoubleNorm<NumberVector<?>>
obj
- Objectpublic int getSelectedDimension()
@Deprecated public BitSet getSelectedDimensions()
DimensionSelectingSubspaceDistanceFunction
getSelectedDimensions
in interface DimensionSelectingSubspaceDistanceFunction<NumberVector<?>,DoubleDistance>
public void setSelectedDimensions(BitSet dimensions)
DimensionSelectingSubspaceDistanceFunction
setSelectedDimensions
in interface DimensionSelectingSubspaceDistanceFunction<NumberVector<?>,DoubleDistance>
dimensions
- a BitSet designating the new selected dimensionspublic VectorTypeInformation<? super NumberVector<?>> getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<NumberVector<?>,DoubleDistance>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<NumberVector<?>,DoubleDistance>
getInputTypeRestriction
in class AbstractVectorDoubleDistanceFunction
public DoubleDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<NumberVector<?>,DoubleDistance>
getDistanceFactory
in class AbstractVectorDoubleDistanceFunction