public class LocalitySensitiveHashSearch extends UpdatableSearcher
distanceMeasure
Constructor and Description |
---|
LocalitySensitiveHashSearch(DistanceMeasure distanceMeasure,
int searchSize) |
Modifier and Type | Method and Description |
---|---|
void |
add(Vector vector)
Add a new Vector to the Searcher that will be checked when getting
the nearest neighbors.
|
void |
clear() |
int |
getSearchSize() |
Iterator<Vector> |
iterator() |
boolean |
remove(Vector v,
double epsilon) |
protected static WeightedThing<Vector> |
removeHash(WeightedThing<Vector> input) |
int |
resetEvaluationCount()
This is only for testing.
|
List<WeightedThing<Vector>> |
search(Vector query,
int limit)
When querying the Searcher for the closest vectors, a list of WeightedThing
|
WeightedThing<Vector> |
searchFirst(Vector query,
boolean differentThanQuery)
Returns the closest vector to the query.
|
void |
setRaiseHashLimitStrategy(double strategy) |
void |
setSearchSize(int size) |
int |
size()
Returns the number of WeightedVectors being searched for nearest neighbors.
|
addAll, addAllMatrixSlices, addAllMatrixSlicesAsWeightedVectors, getCandidateQueue, getDistanceMeasure, search, searchFirst
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public LocalitySensitiveHashSearch(DistanceMeasure distanceMeasure, int searchSize)
public List<WeightedThing<Vector>> search(Vector query, int limit)
Searcher
public WeightedThing<Vector> searchFirst(Vector query, boolean differentThanQuery)
searchFirst
in class Searcher
query
- the vector to search fordifferentThanQuery
- if true, returns the closest vector different than the query (this
only matters if the query is among the searched vectors), otherwise,
returns the closest vector to the query (even the same vector).protected static WeightedThing<Vector> removeHash(WeightedThing<Vector> input)
public void add(Vector vector)
Searcher
public int size()
Searcher
public int getSearchSize()
public void setSearchSize(int size)
public void setRaiseHashLimitStrategy(double strategy)
public int resetEvaluationCount()
public boolean remove(Vector v, double epsilon)
remove
in class UpdatableSearcher
public void clear()
clear
in class UpdatableSearcher
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.