public class RandomBallCover<V extends Vec> extends Object implements VectorCollection<V>
Modifier and Type | Class and Description |
---|---|
static class |
RandomBallCover.RandomBallCoverFactory<V extends Vec> |
Constructor and Description |
---|
RandomBallCover(List<V> vecs,
DistanceMetric dm)
Creates a new Random Ball Cover
|
RandomBallCover(List<V> vecs,
DistanceMetric dm,
ExecutorService execServ)
Creates a new Random Ball Cover
|
Modifier and Type | Method and Description |
---|---|
RandomBallCover<V> |
clone() |
List<? extends VecPaired<V,Double>> |
search(Vec query,
double range)
Searches the space for all vectors that are within a given range of the query vector.
|
List<? extends VecPaired<V,Double>> |
search(Vec query,
int neighbors)
Searches the space for the k neighbors that are closest to the given query vector
|
int |
size()
Returns the number of vectors stored in the collection
|
public RandomBallCover(List<V> vecs, DistanceMetric dm, ExecutorService execServ)
vecs
- the vectors to place into the RBCdm
- the distance metric to useexecServ
- the source of threads for parallel constructionpublic RandomBallCover(List<V> vecs, DistanceMetric dm)
vecs
- the vectors to place into the RBCdm
- the distance metric to usepublic List<? extends VecPaired<V,Double>> search(Vec query, double range)
VectorCollection
search
in interface VectorCollection<V extends Vec>
query
- the vector we want to find others nearrange
- the search range around our querypublic List<? extends VecPaired<V,Double>> search(Vec query, int neighbors)
VectorCollection
search
in interface VectorCollection<V extends Vec>
query
- the vector we want to find neighbors ofneighbors
- the maximum number of neighbors to returnpublic int size()
VectorCollection
size
in interface VectorCollection<V extends Vec>
public RandomBallCover<V> clone()
Copyright © 2017. All rights reserved.