public class SparseLPNormDistanceFunction extends AbstractPrimitiveDistanceFunction<SparseNumberVector<?>,DoubleDistance> implements DoubleNorm<SparseNumberVector<?>>
Modifier and Type | Class and Description |
---|---|
static class |
SparseLPNormDistanceFunction.Parameterizer
Parameterizer
|
Modifier and Type | Field and Description |
---|---|
private double |
invp
Keeps the currently set p.
|
private double |
p
Keeps the currently set p.
|
Constructor and Description |
---|
SparseLPNormDistanceFunction(double p)
Provides a LP-Norm for FeatureVectors.
|
Modifier and Type | Method and Description |
---|---|
DoubleDistance |
distance(SparseNumberVector<?> v1,
SparseNumberVector<?> v2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
double |
doubleDistance(SparseNumberVector<?> v1,
SparseNumberVector<?> v2)
Computes the distance between two given Objects according to this distance
function.
|
double |
doubleNorm(SparseNumberVector<?> v1)
Compute the norm of object obj as double value.
|
DoubleDistance |
getDistanceFactory()
Method to get the distance functions factory.
|
SimpleTypeInformation<? super SparseNumberVector<?>> |
getInputTypeRestriction()
Get the input data type of the function.
|
boolean |
isMetric()
Is this distance function metric (in particular, does it satisfy the
triangle equation?)
|
DoubleDistance |
norm(SparseNumberVector<?> obj)
Compute the norm of object obj.
|
instantiate, isSymmetric
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
instantiate, isSymmetric
private double p
private double invp
public SparseLPNormDistanceFunction(double p)
public double doubleDistance(SparseNumberVector<?> v1, SparseNumberVector<?> v2)
PrimitiveDoubleDistanceFunction
doubleDistance
in interface PrimitiveDoubleDistanceFunction<SparseNumberVector<?>>
v1
- first Objectv2
- second Objectpublic double doubleNorm(SparseNumberVector<?> v1)
DoubleNorm
doubleNorm
in interface DoubleNorm<SparseNumberVector<?>>
v1
- Objectpublic DoubleDistance norm(SparseNumberVector<?> obj)
Norm
norm
in interface Norm<SparseNumberVector<?>,DoubleDistance>
obj
- Objectpublic DoubleDistance distance(SparseNumberVector<?> v1, SparseNumberVector<?> v2)
PrimitiveDistanceFunction
distance
in interface PrimitiveDistanceFunction<SparseNumberVector<?>,DoubleDistance>
distance
in class AbstractPrimitiveDistanceFunction<SparseNumberVector<?>,DoubleDistance>
v1
- first DatabaseObjectv2
- second DatabaseObjectpublic DoubleDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<SparseNumberVector<?>,DoubleDistance>
getDistanceFactory
in class AbstractPrimitiveDistanceFunction<SparseNumberVector<?>,DoubleDistance>
public SimpleTypeInformation<? super SparseNumberVector<?>> getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<SparseNumberVector<?>,DoubleDistance>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<SparseNumberVector<?>,DoubleDistance>
public boolean isMetric()
DistanceFunction
isMetric
in interface DistanceFunction<SparseNumberVector<?>,DoubleDistance>
isMetric
in class AbstractPrimitiveDistanceFunction<SparseNumberVector<?>,DoubleDistance>
true
when metric.