O
- Object typepublic class PrecomputedDistanceMatrix<O> extends AbstractIndex<O> implements DistanceIndex<O>
Modifier and Type | Class and Description |
---|---|
static class |
PrecomputedDistanceMatrix.Factory<O>
Factory for the index.
|
private class |
PrecomputedDistanceMatrix.PrecomputedDistanceQuery
Distance query using the precomputed matrix.
|
Modifier and Type | Field and Description |
---|---|
protected DistanceFunction<? super O> |
distanceFunction
Nested distance function.
|
protected DistanceQuery<O> |
distanceQuery
Nested distance query.
|
private DBIDRange |
ids
DBID range.
|
private static Logging |
LOG
Class logger.
|
private double[] |
matrix
Distance matrix.
|
private int |
size
Size of DBID range.
|
relation
Constructor and Description |
---|
PrecomputedDistanceMatrix(Relation<O> relation,
DistanceFunction<? super O> distanceFunction)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
DistanceQuery<O> |
getDistanceQuery(DistanceFunction<? super O> distanceFunction,
Object... hints)
Get a KNN query object for the given distance query and k.
|
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
private int |
getOffset(int x,
int y)
Array offset computation.
|
String |
getShortName()
A short name for the result, useful for file names.
|
void |
initialize()
Initialize the index.
|
void |
logStatistics()
Send statistics to the logger, if enabled.
|
protected static int |
triangleSize(int x)
Compute the size of a complete x by x triangle (minus diagonal)
|
private static final Logging LOG
protected final DistanceFunction<? super O> distanceFunction
protected DistanceQuery<O> distanceQuery
private double[] matrix
private DBIDRange ids
private int size
public PrecomputedDistanceMatrix(Relation<O> relation, DistanceFunction<? super O> distanceFunction)
relation
- Data relationdistanceFunction
- Distance functionpublic void initialize()
Index
initialize
in interface Index
protected static int triangleSize(int x)
x
- Offsetprivate int getOffset(int x, int y)
x
- X parametery
- Y parameterpublic void logStatistics()
Index
logStatistics
in interface Index
public String getLongName()
Result
getLongName
in interface Result
getLongName
in class AbstractIndex<O>
public String getShortName()
Result
getShortName
in interface Result
getShortName
in class AbstractIndex<O>
public DistanceQuery<O> getDistanceQuery(DistanceFunction<? super O> distanceFunction, Object... hints)
DistanceIndex
getDistanceQuery
in interface DistanceIndex<O>
distanceFunction
- Distance function to use.hints
- Hints for the optimizernull
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.