public class SubspaceLPNormDistanceFunction extends AbstractDimensionsSelectingDistanceFunction<NumberVector> implements SpatialPrimitiveDistanceFunction<NumberVector>, Norm<NumberVector>, NumberVectorDistanceFunction<NumberVector>
NumberVector
s only in
specified dimensions.Modifier and Type | Class and Description |
---|---|
static class |
SubspaceLPNormDistanceFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private double |
p
Value of p
|
dimensions
Constructor and Description |
---|
SubspaceLPNormDistanceFunction(double p,
long[] dimensions)
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) |
VectorFieldTypeInformation<? super NumberVector> |
getInputTypeRestriction()
Get the input data type of the function.
|
double |
getP()
Get the value of p.
|
int |
hashCode() |
<T extends NumberVector> |
instantiate(Relation<T> database)
Instantiate with a database to get the actual distance query.
|
boolean |
isMetric()
Is this distance function metric (satisfy the triangle inequality)
|
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.
|
getSelectedDimensions, setSelectedDimensions
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isSquared, isSymmetric
public SubspaceLPNormDistanceFunction(double p, long[] dimensions)
dimensions
- Selected dimensionsp
- p valuepublic double getP()
public double distance(NumberVector v1, NumberVector v2)
PrimitiveDistanceFunction
distance
in interface NumberVectorDistanceFunction<NumberVector>
distance
in interface PrimitiveDistanceFunction<NumberVector>
distance
in class AbstractDimensionsSelectingDistanceFunction<NumberVector>
v1
- first DatabaseObjectv2
- second DatabaseObjectprotected double minDistObject(SpatialComparable mbr, NumberVector v)
public 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 <T extends NumberVector> SpatialPrimitiveDistanceQuery<T> instantiate(Relation<T> database)
DistanceFunction
instantiate
in interface DistanceFunction<NumberVector>
instantiate
in interface PrimitiveDistanceFunction<NumberVector>
instantiate
in interface SpatialPrimitiveDistanceFunction<NumberVector>
database
- The representation to usepublic VectorFieldTypeInformation<? super NumberVector> getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<NumberVector>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<NumberVector>
public boolean isMetric()
DistanceFunction
isMetric
in interface DistanceFunction<NumberVector>
true
when metric.public boolean equals(java.lang.Object obj)
equals
in class AbstractDimensionsSelectingDistanceFunction<NumberVector>
public int hashCode()
hashCode
in class AbstractDimensionsSelectingDistanceFunction<NumberVector>
Copyright © 2019 ELKI Development Team. License information.