public class ProjectionSearch extends UpdatableSearcher
distanceMeasure| Constructor and Description |
|---|
ProjectionSearch(DistanceMeasure distanceMeasure,
int numProjections,
int searchSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Vector vector)
Adds a WeightedVector into the set of projections for later searching.
|
void |
clear() |
Iterator<Vector> |
iterator() |
boolean |
remove(Vector vector,
double epsilon) |
List<WeightedThing<Vector>> |
search(Vector query,
int limit)
Searches for the query vector returning the closest limit referenceVectors.
|
WeightedThing<Vector> |
searchFirst(Vector query,
boolean differentThanQuery)
Returns the closest vector to the query.
|
int |
size()
Returns the number of scalarProjections that we can search
|
addAll, addAllMatrixSlices, addAllMatrixSlicesAsWeightedVectors, getCandidateQueue, getDistanceMeasure, search, searchFirstclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic ProjectionSearch(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 UpdatableSearcherCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.