Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
A
- add(int) - Method in class com.github.jelmerk.knn.util.ArrayBitSet
-
Add element to the bitset.
- add(TItem) - Method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Add a new item to the index.
- add(TItem) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Add a new item to the index.
- add(TItem) - Method in interface com.github.jelmerk.knn.Index
-
Add a new item to the index.
- addAll(Collection<TItem>) - Method in interface com.github.jelmerk.knn.Index
-
Add multiple items to the index
- addAll(Collection<TItem>, int, ProgressListener, int) - Method in interface com.github.jelmerk.knn.Index
-
Add multiple items to the index.
- addAll(Collection<TItem>, ProgressListener) - Method in interface com.github.jelmerk.knn.Index
-
Add multiple items to the index.
- ArrayBitSet - Class in com.github.jelmerk.knn.util
-
Bitset.
- ArrayBitSet(int) - Constructor for class com.github.jelmerk.knn.util.ArrayBitSet
-
Initializes a new instance of the
ArrayBitSet
class. - ArrayBitSet(ArrayBitSet, int) - Constructor for class com.github.jelmerk.knn.util.ArrayBitSet
-
Initializes a new instance of the
ArrayBitSet
class. - asExactIndex() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Creates a read only view on top of this index that uses pairwise comparision when doing distance search.
B
- borrowObject() - Method in class com.github.jelmerk.knn.util.GenericObjectPool
-
Borrows an object from the pool.
- BruteForceIndex<TId,
TVector, TItem extends Item<TId, TVector>, TDistance> - Class in com.github.jelmerk.knn.bruteforce -
Implementation of
Index
that does pairwise comparison and as such can be used as a baseline for measuring approximate nearest neighbors index precision. - BruteForceIndex.Builder<TVector,
TDistance> - Class in com.github.jelmerk.knn.bruteforce -
Builder for initializing an
BruteForceIndex
instance. - build() - Method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex.Builder
-
Builds the BruteForceIndex instance.
- build() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex.Builder
-
Build the index that uses java object serializers to store the items when reading and writing the index.
- build() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex.RefinedBuilder
-
Build the index.
C
- ClassLoaderObjectInputStream - Class in com.github.jelmerk.knn.util
-
A special ObjectInputStream that loads a class based on a specified ClassLoader rather than the system default.
- ClassLoaderObjectInputStream(ClassLoader, InputStream) - Constructor for class com.github.jelmerk.knn.util.ClassLoaderObjectInputStream
-
Constructs a new ClassLoaderObjectInputStream.
- clear() - Method in class com.github.jelmerk.knn.util.ArrayBitSet
-
Clears the bitset.
- com.github.jelmerk.knn - package com.github.jelmerk.knn
- com.github.jelmerk.knn.bruteforce - package com.github.jelmerk.knn.bruteforce
- com.github.jelmerk.knn.hnsw - package com.github.jelmerk.knn.hnsw
- com.github.jelmerk.knn.util - package com.github.jelmerk.knn.util
- compareTo(SearchResult<TItem, TDistance>) - Method in class com.github.jelmerk.knn.SearchResult
- contains(int) - Method in class com.github.jelmerk.knn.util.ArrayBitSet
-
Returns true if this set contains the specified element
- contains(TId) - Method in interface com.github.jelmerk.knn.Index
-
Check if an item is contained in this index
- create(TItem, TDistance) - Static method in class com.github.jelmerk.knn.SearchResult
-
Convenience method for creating search results who's distances are Comparable.
D
- DEFAULT_EF - Static variable in class com.github.jelmerk.knn.hnsw.HnswIndex.BuilderBase
- DEFAULT_EF_CONSTRUCTION - Static variable in class com.github.jelmerk.knn.hnsw.HnswIndex.BuilderBase
- DEFAULT_M - Static variable in class com.github.jelmerk.knn.hnsw.HnswIndex.BuilderBase
- DEFAULT_PROGRESS_UPDATE_INTERVAL - Static variable in interface com.github.jelmerk.knn.Index
-
By default after indexing this many items progress will be reported to registered progress listeners.
- DEFAULT_REMOVE_ENABLED - Static variable in class com.github.jelmerk.knn.hnsw.HnswIndex.BuilderBase
- dimensions() - Method in interface com.github.jelmerk.knn.Item
-
Returns the dimensionality of the vector.
- distance() - Method in class com.github.jelmerk.knn.SearchResult
-
Returns the distance from the search query.
- distance(TVector, TVector) - Method in interface com.github.jelmerk.knn.DistanceFunction
-
Gets the distance between 2 items.
- DistanceFunction<TVector,
TDistance> - Interface in com.github.jelmerk.knn -
Calculates distance between 2 vectors.
- DistanceFunctions - Class in com.github.jelmerk.knn
-
Collection of distance functions.
- DOUBLE_BRAY_CURTIS_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the bray curtis distance.
- DOUBLE_CANBERRA_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the canberra distance.
- DOUBLE_CORRELATION_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the correlation distance.
- DOUBLE_COSINE_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the cosine distance.
- DOUBLE_EUCLIDEAN_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the euclidean distance.
- DOUBLE_INNER_PRODUCT - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the inner product.
- DOUBLE_MANHATTAN_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the manhattan distance.
- DOUBLE_SPARSE_VECTOR_INNER_PRODUCT - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the inner product.
E
- equals(Object) - Method in class com.github.jelmerk.knn.SearchResult
F
- findNearest(TVector, int) - Method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Find the items closest to the passed in vector.
- findNearest(TVector, int) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Find the items closest to the passed in vector.
- findNearest(TVector, int) - Method in interface com.github.jelmerk.knn.Index
-
Find the items closest to the passed in vector.
- findNeighbors(TId, int) - Method in interface com.github.jelmerk.knn.Index
-
Find the items closest to the item identified by the passed in id.
- FLOAT_BRAY_CURTIS_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the bray curtis distance.
- FLOAT_CANBERRA_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the canberra distance.
- FLOAT_CORRELATION_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the correlation distance.
- FLOAT_COSINE_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the cosine distance.
- FLOAT_EUCLIDEAN_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the euclidean distance.
- FLOAT_INNER_PRODUCT - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the inner product distance.
- FLOAT_MANHATTAN_DISTANCE - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the manhattan distance.
- FLOAT_SPARSE_VECTOR_INNER_PRODUCT - Static variable in class com.github.jelmerk.knn.DistanceFunctions
-
Calculates the inner product.
G
- GenericObjectPool<T> - Class in com.github.jelmerk.knn.util
-
Generic object pool.
- GenericObjectPool(Supplier<T>, int) - Constructor for class com.github.jelmerk.knn.util.GenericObjectPool
-
Constructs a new pool
- get(TId) - Method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Returns an item by its identifier.
- get(TId) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns an item by its identifier.
- get(TId) - Method in interface com.github.jelmerk.knn.Index
-
Returns an item by its identifier.
- getDimensions() - Method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Returns the dimensionality of the items stored in this index.
- getDimensions() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns the dimensionality of the items stored in this index.
- getDistanceComparator() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns the comparator used to compare distances.
- getDistanceFunction() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns the distance function.
- getEf() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
The size of the dynamic list for the nearest neighbors (used during the search)
- getEfConstruction() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns the parameter has the same meaning as ef, but controls the index time / index precision.
- getItemIdSerializer() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns the serializer used to serialize item id's when saving the index.
- getItemSerializer() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns the serializer used to serialize items when saving the index.
- getM() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns the number of bi-directional links created for every new element during construction.
- getMaxItemCount() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns the maximum number of items the index can hold.
H
- hash32(byte[]) - Static method in class com.github.jelmerk.knn.util.Murmur3
-
Murmur3 32-bit variant.
- hash32(byte[], int, int, int) - Static method in class com.github.jelmerk.knn.util.Murmur3
-
Murmur3 32-bit variant.
- hashCode() - Method in class com.github.jelmerk.knn.SearchResult
- HnswIndex<TId,
TVector, TItem extends Item<TId, TVector>, TDistance> - Class in com.github.jelmerk.knn.hnsw -
Implementation of
Index
that implements the hnsw algorithm. - HnswIndex.Builder<TVector,
TDistance> - Class in com.github.jelmerk.knn.hnsw -
Builder for initializing an
HnswIndex
instance. - HnswIndex.BuilderBase<TBuilder extends HnswIndex.BuilderBase<TBuilder,
TVector, TDistance>, TVector, TDistance> - Class in com.github.jelmerk.knn.hnsw -
Base class for HNSW index builders.
- HnswIndex.RefinedBuilder<TId,
TVector, TItem extends Item<TId, TVector>, TDistance> - Class in com.github.jelmerk.knn.hnsw -
Extension of
HnswIndex.Builder
that has knows what type of item is going to be stored in the index.
I
- id() - Method in interface com.github.jelmerk.knn.Item
-
Returns the identifier of this item.
- Index<TId,
TVector, TItem extends Item<TId, TVector>, TDistance> - Interface in com.github.jelmerk.knn -
K-nearest neighbors search index.
- IndexException - Exception in com.github.jelmerk.knn
-
Base class for exceptions thrown by
Index
implementations. - IndexException() - Constructor for exception com.github.jelmerk.knn.IndexException
-
Constructs an IndexException
- IndexException(String) - Constructor for exception com.github.jelmerk.knn.IndexException
-
Constructs a IndexException with the specified detail message.
- IndexException(String, Throwable) - Constructor for exception com.github.jelmerk.knn.IndexException
-
Constructs a IndexException with the specified detail message and cause.
- indices() - Method in class com.github.jelmerk.knn.SparseVector
-
Returns the index array.
- INSTANCE - Static variable in class com.github.jelmerk.knn.NullProgressListener
-
Singleton instance of
NullProgressListener
. - isRemoveEnabled() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns if removes are enabled.
- item() - Method in class com.github.jelmerk.knn.SearchResult
-
Returns the item.
- Item<TId,
TVector> - Interface in com.github.jelmerk.knn -
Indexable item.
- items() - Method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Returns all items in the index.
- items() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns all items in the index.
- items() - Method in interface com.github.jelmerk.knn.Index
-
Returns all items in the index.
J
- JavaObjectSerializer<T> - Class in com.github.jelmerk.knn
-
Implementation of
ObjectSerializer
that uses java serialization to write the value. - JavaObjectSerializer() - Constructor for class com.github.jelmerk.knn.JavaObjectSerializer
L
- load(File) - Static method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Restores a
BruteForceIndex
from a File. - load(File) - Static method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Restores a
HnswIndex
from a File. - load(File, ClassLoader) - Static method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Restores a
BruteForceIndex
from a File. - load(File, ClassLoader) - Static method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Restores a
HnswIndex
from a File. - load(InputStream) - Static method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Restores a
BruteForceIndex
from an InputStream. - load(InputStream) - Static method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Restores a
HnswIndex
from an InputStream. - load(InputStream, ClassLoader) - Static method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Restores a
BruteForceIndex
from an InputStream. - load(InputStream, ClassLoader) - Static method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Restores a
HnswIndex
from an InputStream. - load(Path) - Static method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Restores a
BruteForceIndex
from a Path. - load(Path) - Static method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Restores a
HnswIndex
from a Path. - load(Path, ClassLoader) - Static method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Restores a
BruteForceIndex
from a Path. - load(Path, ClassLoader) - Static method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Restores a
HnswIndex
from a Path.
M
- Murmur3 - Class in com.github.jelmerk.knn.util
-
Murmur3 is successor to Murmur2 fast non-crytographic hash algorithms.
- Murmur3() - Constructor for class com.github.jelmerk.knn.util.Murmur3
N
- NamedThreadFactory - Class in com.github.jelmerk.knn.util
-
A
ThreadFactory
implementation that names each thread created using a user defined format string. - NamedThreadFactory(String) - Constructor for class com.github.jelmerk.knn.util.NamedThreadFactory
-
Constructs a new NamedThreadFactory
- newBuilder(int, DistanceFunction<TVector, TDistance>) - Static method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Start the process of building a new BruteForce index.
- newBuilder(int, DistanceFunction<TVector, TDistance>, int) - Static method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Start the process of building a new HNSW index.
- newBuilder(int, DistanceFunction<TVector, TDistance>, Comparator<TDistance>) - Static method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Start the process of building a new BruteForce index.
- newBuilder(int, DistanceFunction<TVector, TDistance>, Comparator<TDistance>, int) - Static method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Start the process of building a new HNSW index.
- newThread(Runnable) - Method in class com.github.jelmerk.knn.util.NamedThreadFactory
- NullProgressListener - Class in com.github.jelmerk.knn
-
Implementation of
ProgressListener
that does nothing.
O
- ObjectSerializer<T> - Interface in com.github.jelmerk.knn
-
Implementations of this interface are used to customize how objects will be stored when the index is persisted
P
- ProgressListener - Interface in com.github.jelmerk.knn
-
Callback interface for reporting on the progress of an index operation.
R
- read(ObjectInput) - Method in class com.github.jelmerk.knn.JavaObjectSerializer
-
Reads an item from an ObjectOutput implementation.
- read(ObjectInput) - Method in interface com.github.jelmerk.knn.ObjectSerializer
-
Reads an item from an ObjectOutput implementation.
- remove(int) - Method in class com.github.jelmerk.knn.util.ArrayBitSet
-
Removes element from the bitset.
- remove(TId, long) - Method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Removes an item from the index.
- remove(TId, long) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Removes an item from the index.
- remove(TId, long) - Method in interface com.github.jelmerk.knn.Index
-
Removes an item from the index.
- resize(int) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Changes the maximum capacity of the index.
- resolveClass(ObjectStreamClass) - Method in class com.github.jelmerk.knn.util.ClassLoaderObjectInputStream
-
Resolve a class specified by the descriptor using the specified ClassLoader or the super ClassLoader.
- resolveProxyClass(String[]) - Method in class com.github.jelmerk.knn.util.ClassLoaderObjectInputStream
-
Create a proxy class that implements the specified interfaces using the specified ClassLoader or the super ClassLoader.
- returnObject(T) - Method in class com.github.jelmerk.knn.util.GenericObjectPool
-
Returns an instance to the pool.
S
- save(File) - Method in interface com.github.jelmerk.knn.Index
-
Saves the index to a file.
- save(OutputStream) - Method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Saves the index to an OutputStream.
- save(OutputStream) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Saves the index to an OutputStream.
- save(OutputStream) - Method in interface com.github.jelmerk.knn.Index
-
Saves the index to an OutputStream.
- save(Path) - Method in interface com.github.jelmerk.knn.Index
-
Saves the index to a path.
- SearchResult<TItem,
TDistance> - Class in com.github.jelmerk.knn -
Result of a nearest neighbour search.
- SearchResult(TItem, TDistance, Comparator<TDistance>) - Constructor for class com.github.jelmerk.knn.SearchResult
-
Constructs a new SearchResult instance.
- setEf(int) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Set the size of the dynamic list for the nearest neighbors (used during the search)
- size() - Method in class com.github.jelmerk.knn.bruteforce.BruteForceIndex
-
Returns the size of the index.
- size() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex
-
Returns the size of the index.
- size() - Method in interface com.github.jelmerk.knn.Index
-
Returns the size of the index.
- SizeLimitExceededException - Exception in com.github.jelmerk.knn.hnsw
-
Thrown to indicate the size of the index has been exceeded.
- SizeLimitExceededException(String) - Constructor for exception com.github.jelmerk.knn.hnsw.SizeLimitExceededException
-
Constructs a SizeLimitExceededException with the specified detail message.
- SparseVector<TVector> - Class in com.github.jelmerk.knn
-
A sparse vector represented by an index array and a value array.
- SparseVector(int[], TVector) - Constructor for class com.github.jelmerk.knn.SparseVector
-
Constructs a new SparseVector instance.
T
- toString() - Method in class com.github.jelmerk.knn.SearchResult
U
- UncategorizedIndexException - Exception in com.github.jelmerk.knn
-
Thrown to indicate that a nested exception occurred in one of the worker threads.
- UncategorizedIndexException(String, Throwable) - Constructor for exception com.github.jelmerk.knn.UncategorizedIndexException
-
Constructs a UncategorizedIndexException with the specified detail message and cause.
- updateProgress(int, int) - Method in class com.github.jelmerk.knn.NullProgressListener
-
Called by the index at set intervals to report progress of the indexing process.
- updateProgress(int, int) - Method in interface com.github.jelmerk.knn.ProgressListener
-
Called by the index at set intervals to report progress of the indexing process.
V
- values() - Method in class com.github.jelmerk.knn.SparseVector
-
Returns the values array.
- vector() - Method in interface com.github.jelmerk.knn.Item
-
Returns the vector to perform the distance calculation on.
- version() - Method in interface com.github.jelmerk.knn.Item
-
Returns the version of the item.
W
- withCustomSerializers(ObjectSerializer<TId>, ObjectSerializer<TItem>) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex.Builder
-
Register the serializers used when saving the index.
- withCustomSerializers(ObjectSerializer<TId>, ObjectSerializer<TItem>) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex.RefinedBuilder
-
Register the serializers used when saving the index.
- withEf(int) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex.BuilderBase
-
The size of the dynamic list for the nearest neighbors (used during the search).
- withEfConstruction(int) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex.BuilderBase
-
` The parameter has the same meaning as ef, but controls the index time / index precision.
- withM(int) - Method in class com.github.jelmerk.knn.hnsw.HnswIndex.BuilderBase
-
Sets the number of bi-directional links created for every new element during construction.
- withRemoveEnabled() - Method in class com.github.jelmerk.knn.hnsw.HnswIndex.BuilderBase
-
Call to enable support for the experimental remove operation.
- write(T, ObjectOutput) - Method in class com.github.jelmerk.knn.JavaObjectSerializer
-
Writes the item to an ObjectOutput implementation.
- write(T, ObjectOutput) - Method in interface com.github.jelmerk.knn.ObjectSerializer
-
Writes the item to an ObjectOutput implementation.
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form