Package elki.index.vafile
Class VALPNormDistance
- java.lang.Object
-
- elki.index.vafile.VALPNormDistance
-
public class VALPNormDistance extends java.lang.Object
Lp-Norm distance function for partially computed objects.- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private double[][]
lookup
Lookup table for grid cells.private double
onebyp
Value of 1/p for lP norm.private VectorApproximation
queryApprox
Approximation of the query vector.
-
Constructor Summary
Constructors Constructor Description VALPNormDistance(double p, double[][] splitPositions, NumberVector query, VectorApproximation queryApprox)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getMaxDist(VectorApproximation vec)
Get the maximum distance.double
getMinDist(VectorApproximation vec)
Get the minimum distance to approximated vector vec.double
getPartialMaxDist(int dimension, int vp)
Get the maximum distance contribution of a single dimension.double
getPartialMaxMaxDist(int dimension)
Get the maximum distance.double
getPartialMinDist(int dimension, int vp)
Get the minimum distance contribution of a single dimension.private void
initializeLookupTable(double[][] splitPositions, NumberVector query, double p)
Initialize the lookup table.
-
-
-
Field Detail
-
onebyp
private final double onebyp
Value of 1/p for lP norm.
-
lookup
private double[][] lookup
Lookup table for grid cells.
-
queryApprox
private VectorApproximation queryApprox
Approximation of the query vector.
-
-
Constructor Detail
-
VALPNormDistance
public VALPNormDistance(double p, double[][] splitPositions, NumberVector query, VectorApproximation queryApprox)
Constructor.- Parameters:
p
- Value of psplitPositions
- Split positionsquery
- Query vectorqueryApprox
- Query approximation
-
-
Method Detail
-
getPartialMinDist
public double getPartialMinDist(int dimension, int vp)
Get the minimum distance contribution of a single dimension.- Parameters:
dimension
- Dimensionvp
- Vector position- Returns:
- Increment
-
getMinDist
public double getMinDist(VectorApproximation vec)
Get the minimum distance to approximated vector vec.- Parameters:
vec
- Vector approximation- Returns:
- Minimum distance
-
getPartialMaxDist
public double getPartialMaxDist(int dimension, int vp)
Get the maximum distance contribution of a single dimension.- Parameters:
dimension
- Dimensionvp
- Vector position- Returns:
- Increment
-
getMaxDist
public double getMaxDist(VectorApproximation vec)
Get the maximum distance.- Parameters:
vec
- Approximation vector- Returns:
- Maximum distance of the vector
-
getPartialMaxMaxDist
public double getPartialMaxMaxDist(int dimension)
Get the maximum distance.- Parameters:
dimension
- Dimension- Returns:
- Maximum distance in the given dimension
-
initializeLookupTable
private void initializeLookupTable(double[][] splitPositions, NumberVector query, double p)
Initialize the lookup table.- Parameters:
splitPositions
- Split positionsquery
- Query vectorp
- p
-
-