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 classInMemoryLSHIndex.Instance.LSHKNNQueryClass for handling kNN queries against the LSH index.protected classInMemoryLSHIndex.Instance.LSHRangeQueryClass 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>>hashfunctionsHash functions to use.(package private) java.util.ArrayList<it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<DBIDs>>hashtablesThe actual tableprivate intnumberOfBucketsNumber 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 DBIDsgetCandidates(V obj)Get the candidates: points which have at least one hash bucket in common.LogginggetLogger()Get the class logger.voidinitialize()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:IndexInitialize the index. For static indexes, this is the moment the index is bulk loaded.- Specified by:
initializein interfaceIndex
-
getLogger
public Logging getLogger()
Description copied from class:AbstractRefiningIndexGet the class logger.- Specified by:
getLoggerin classAbstractRefiningIndex<V>- Returns:
- Logger
-
kNNByObject
public KNNSearcher<V> kNNByObject(DistanceQuery<V> distanceQuery, int maxk, int flags)
Description copied from interface:KNNIndexGet 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:
kNNByObjectin 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:RangeIndexGet 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:
rangeByObjectin interfaceRangeIndex<V>- Parameters:
distanceQuery- Distance querymaxradius- Maximum rangeflags- Hints for the optimizer- Returns:
- KNN Query object or
null
-
-