public class RandomBallCover<V extends Vec> extends Object implements IncrementalCollection<V>
Modifier and Type | Class and Description |
---|---|
static class |
RandomBallCover.RandomBallCoverFactory<V extends Vec> |
Constructor and Description |
---|
RandomBallCover(DistanceMetric dm) |
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() |
void |
insert(V x)
Incrementally adds the given datapoint into the collection
|
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 RandomBallCover(DistanceMetric dm)
public 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 void insert(V x)
IncrementalCollection
insert
in interface IncrementalCollection<V extends Vec>
x
- the vector to add to the collectionpublic int size()
VectorCollection
size
in interface VectorCollection<V extends Vec>
public RandomBallCover<V> clone()
clone
in interface IncrementalCollection<V extends Vec>
clone
in interface VectorCollection<V extends Vec>
clone
in class Object
Copyright © 2017. All rights reserved.