@Alias(value="de.lmu.ifi.dbs.elki.distance.distancefunction.subspace.DimensionSelectingDistanceFunction") public class OnedimensionalDistanceFunction extends AbstractNumberVectorDistanceFunction implements SpatialPrimitiveDistanceFunction<NumberVector>, DimensionSelectingSubspaceDistanceFunction<NumberVector>, Norm<NumberVector>
Modifier and Type | Class and Description |
---|---|
static class |
OnedimensionalDistanceFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private int |
dim
The dimension to be considered for distance computation.
|
Constructor and Description |
---|
OnedimensionalDistanceFunction(int dim)
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.
|
boolean |
equals(java.lang.Object obj) |
VectorTypeInformation<? super NumberVector> |
getInputTypeRestriction()
Get the input data type of the function.
|
int |
getSelectedDimension()
Returns the selected dimension.
|
long[] |
getSelectedDimensions()
Deprecated.
|
int |
hashCode() |
double |
minDist(SpatialComparable mbr1,
SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this distance
function.
|
double |
norm(NumberVector obj)
Compute the norm of object obj.
|
void |
setSelectedDimensions(long[] dimensions)
Deprecated.
|
dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
instantiate
public OnedimensionalDistanceFunction(int dim)
dim
- Dimensionpublic double distance(NumberVector v1, NumberVector v2)
PrimitiveDistanceFunction
distance
in interface NumberVectorDistanceFunction<NumberVector>
distance
in interface PrimitiveDistanceFunction<NumberVector>
v1
- first DatabaseObjectv2
- second DatabaseObjectpublic double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDistanceFunction
minDist
in interface SpatialPrimitiveDistanceFunction<NumberVector>
mbr1
- the first MBR objectmbr2
- the second MBR objectpublic double norm(NumberVector obj)
Norm
norm
in interface Norm<NumberVector>
obj
- Objectpublic int getSelectedDimension()
@Deprecated public long[] getSelectedDimensions()
DimensionSelectingSubspaceDistanceFunction
Warning: no defensive copy is performed.
getSelectedDimensions
in interface DimensionSelectingSubspaceDistanceFunction<NumberVector>
@Deprecated public void setSelectedDimensions(long[] dimensions)
DimensionSelectingSubspaceDistanceFunction
Warning: no defensive copy is performed.
setSelectedDimensions
in interface DimensionSelectingSubspaceDistanceFunction<NumberVector>
dimensions
- a bit set designating the new selected dimensionspublic VectorTypeInformation<? super NumberVector> getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<NumberVector>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<NumberVector>
getInputTypeRestriction
in class AbstractNumberVectorDistanceFunction
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2019 ELKI Development Team. License information.