public class FastProjectionSearch extends UpdatableSearcher
distanceMeasure
Constructor and Description |
---|
FastProjectionSearch(DistanceMeasure distanceMeasure,
int numProjections,
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() |
Iterator<Vector> |
iterator()
This iterates on the snapshot of the contents first instantiated regardless of any future modifications.
|
boolean |
remove(Vector vector,
double epsilon) |
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.
|
int |
size()
Returns the number of WeightedVectors being searched for nearest neighbors.
|
addAll, addAllMatrixSlices, addAllMatrixSlicesAsWeightedVectors, getCandidateQueue, getDistanceMeasure, search, searchFirst
public FastProjectionSearch(DistanceMeasure distanceMeasure, int numProjections, int searchSize)
public void add(Vector vector)
public int size()
public List<WeightedThing<Vector>> search(Vector query, int limit)
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).public boolean remove(Vector vector, double epsilon)
remove
in class UpdatableSearcher
public void clear()
clear
in class UpdatableSearcher
public Iterator<Vector> iterator()
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.