public class EuclideanCollection<V extends Vec> extends Object implements VectorCollection<V>
EuclideanDistance
by brute force search. It does this more
efficiently by decomposing the squared distance intoModifier and Type | Class and Description |
---|---|
static class |
EuclideanCollection.EuclideanCollectionFactory<V extends Vec> |
Constructor and Description |
---|
EuclideanCollection(EuclideanCollection toCopy)
Copy constructor
|
EuclideanCollection(List<V> source)
Creates a new Vector Collection that does an efficient brute force search
for only the Euclidean distance.
|
EuclideanCollection(List<V> source,
ExecutorService threadpool)
Creates a new Vector Collection that does an efficient brute force search
for only the Euclidean distance.
|
Modifier and Type | Method and Description |
---|---|
EuclideanCollection<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 EuclideanCollection(List<V> source)
source
- the set of vectors to form the collectionpublic EuclideanCollection(EuclideanCollection toCopy)
toCopy
- the object to copypublic EuclideanCollection(List<V> source, ExecutorService threadpool)
source
- the set of vectors to form the collectionthreadpool
- the source of threads for parallel constructionpublic 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 EuclideanCollection<V> clone()
Copyright © 2017. All rights reserved.