Package elki.index.lsh
Class InMemoryLSHIndex.Instance
- java.lang.Object
-
- elki.index.AbstractRefiningIndex<V>
-
- elki.index.lsh.InMemoryLSHIndex.Instance
-
- All Implemented Interfaces:
Index
,KNNIndex<V>
,RangeIndex<V>
- Enclosing class:
- InMemoryLSHIndex<V>
public class InMemoryLSHIndex.Instance extends AbstractRefiningIndex<V> implements KNNIndex<V>, RangeIndex<V>
Instance of a LSH index for a single relation.- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
InMemoryLSHIndex.Instance.LSHKNNQuery
Class for handling kNN queries against the LSH index.protected class
InMemoryLSHIndex.Instance.LSHRangeQuery
Class for handling kNN queries against the LSH index.-
Nested classes/interfaces inherited from class elki.index.AbstractRefiningIndex
AbstractRefiningIndex.AbstractRefiningQuery
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.ArrayList<? extends LocalitySensitiveHashFunction<? super V>>
hashfunctions
Hash functions to use.(package private) java.util.ArrayList<it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<DBIDs>>
hashtables
The actual tableprivate int
numberOfBuckets
Number of buckets to use.-
Fields inherited from class elki.index.AbstractRefiningIndex
relation
-
-
Constructor Summary
Constructors Constructor Description Instance(Relation<V> relation, java.util.ArrayList<? extends LocalitySensitiveHashFunction<? super V>> hashfunctions, int numberOfBuckets)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DBIDs
getCandidates(V obj)
Get the candidates: points which have at least one hash bucket in common.Logging
getLogger()
Get the class logger.void
initialize()
Initialize the index.KNNSearcher<V>
kNNByObject(DistanceQuery<V> distanceQuery, int maxk, int flags)
Get a KNN query object for the given distance query and k.RangeSearcher<V>
rangeByObject(DistanceQuery<V> distanceQuery, double maxradius, int flags)
Get a range query object for the given distance query and k.-
Methods inherited from class elki.index.AbstractRefiningIndex
countRefinements, logStatistics, refine
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.index.Index
logStatistics
-
Methods inherited from interface elki.index.RangeIndex
rangeByDBID
-
-
-
-
Field Detail
-
hashfunctions
java.util.ArrayList<? extends LocalitySensitiveHashFunction<? super V>> hashfunctions
Hash functions to use.
-
hashtables
java.util.ArrayList<it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<DBIDs>> hashtables
The actual table
-
numberOfBuckets
private int numberOfBuckets
Number of buckets to use.
-
-
Constructor Detail
-
Instance
public Instance(Relation<V> relation, java.util.ArrayList<? extends LocalitySensitiveHashFunction<? super V>> hashfunctions, int numberOfBuckets)
Constructor.- Parameters:
relation
- Relation to index.hashfunctions
- Hash functions.
-
-
Method Detail
-
initialize
public void initialize()
Description copied from interface:Index
Initialize the index. For static indexes, this is the moment the index is bulk loaded.- Specified by:
initialize
in interfaceIndex
-
getLogger
public Logging getLogger()
Description copied from class:AbstractRefiningIndex
Get the class logger.- Specified by:
getLogger
in classAbstractRefiningIndex<V>
- Returns:
- Logger
-
kNNByObject
public KNNSearcher<V> kNNByObject(DistanceQuery<V> distanceQuery, int maxk, int flags)
Description copied from interface:KNNIndex
Get a KNN query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
kNNByObject
in interfaceKNNIndex<V>
- Parameters:
distanceQuery
- Distance querymaxk
- Maximum value of kflags
- Hints for the optimizer- Returns:
- KNN Query object or
null
-
rangeByObject
public RangeSearcher<V> rangeByObject(DistanceQuery<V> distanceQuery, double maxradius, int flags)
Description copied from interface:RangeIndex
Get a range query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
rangeByObject
in interfaceRangeIndex<V>
- Parameters:
distanceQuery
- Distance querymaxradius
- Maximum rangeflags
- Hints for the optimizer- Returns:
- KNN Query object or
null
-
-