public class WeightedLPNormDistanceFunction extends LPNormDistanceFunction
LPNormDistanceFunction.Parameterizer
Modifier and Type | Field and Description |
---|---|
protected double[] |
weights
Weight array
|
invp, p, P_ID
Constructor and Description |
---|
WeightedLPNormDistanceFunction(double p,
double[] weights)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
doubleDistance(NumberVector<?> v1,
NumberVector<?> v2)
Computes the distance between two given Objects 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<?> v)
Compute the norm of object obj as double value.
|
private double |
doublePreDistance(NumberVector<?> v1,
NumberVector<?> v2,
int start,
int end,
double agg) |
private double |
doublePreDistanceMBR(SpatialComparable mbr1,
SpatialComparable mbr2,
int start,
int end,
double agg) |
private double |
doublePreDistanceVM(NumberVector<?> v,
SpatialComparable mbr,
int start,
int end,
double agg) |
private double |
doublePreNorm(NumberVector<?> v,
int start,
int end,
double agg) |
private double |
doublePreNormMBR(SpatialComparable mbr,
int start,
int end,
double agg) |
boolean |
equals(Object obj) |
SimpleTypeInformation<? super NumberVector<?>> |
getInputTypeRestriction()
Get the input data type of the function.
|
getP, isMetric, toString
instantiate, minDist
norm
dimensionality, dimensionality, dimensionality, dimensionality, distance, getDistanceFactory
isSymmetric
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
distance
getDistanceFactory, isSymmetric
public WeightedLPNormDistanceFunction(double p, double[] weights)
p
- p valueweights
- Weight vectorprivate final double doublePreDistance(NumberVector<?> v1, NumberVector<?> v2, int start, int end, double agg)
private final double doublePreDistanceVM(NumberVector<?> v, SpatialComparable mbr, int start, int end, double agg)
private final double doublePreDistanceMBR(SpatialComparable mbr1, SpatialComparable mbr2, int start, int end, double agg)
private final double doublePreNorm(NumberVector<?> v, int start, int end, double agg)
private final double doublePreNormMBR(SpatialComparable mbr, int start, int end, double agg)
public double doubleDistance(NumberVector<?> v1, NumberVector<?> v2)
PrimitiveDoubleDistanceFunction
doubleDistance
in interface PrimitiveDoubleDistanceFunction<NumberVector<?>>
doubleDistance
in class LPNormDistanceFunction
v1
- first Objectv2
- second Objectpublic double doubleNorm(NumberVector<?> v)
DoubleNorm
doubleNorm
in interface DoubleNorm<NumberVector<?>>
doubleNorm
in class LPNormDistanceFunction
v
- Objectpublic double doubleMinDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDoubleDistanceFunction
doubleMinDist
in interface SpatialPrimitiveDoubleDistanceFunction<NumberVector<?>>
doubleMinDist
in class LPNormDistanceFunction
mbr1
- the first MBR objectmbr2
- the second MBR objectpublic boolean equals(Object obj)
equals
in class LPNormDistanceFunction
public SimpleTypeInformation<? super NumberVector<?>> getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<NumberVector<?>,DoubleDistance>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<NumberVector<?>,DoubleDistance>
getInputTypeRestriction
in class LPNormDistanceFunction