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, searchFirstclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic 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 Searcherquery - 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 UpdatableSearcherpublic void clear()
clear in class UpdatableSearcherpublic Iterator<Vector> iterator()
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.