public class RTree<V extends Vec> extends Object implements VectorCollection<V>
Modifier and Type | Class and Description |
---|---|
static class |
RTree.RTreeFactory<V extends Vec> |
Constructor and Description |
---|
RTree(int dimensions) |
RTree(int dimensions,
DistanceMetric dm) |
RTree(int dimensions,
DistanceMetric dm,
int max) |
RTree(int dimensions,
DistanceMetric dm,
int max,
int min) |
RTree(RTree toCopy)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
void |
add(V v) |
VectorCollection<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 RTree(int dimensions)
public RTree(int dimensions, DistanceMetric dm)
public RTree(int dimensions, DistanceMetric dm, int max)
public RTree(int dimensions, DistanceMetric dm, int max, int min)
public RTree(RTree toCopy)
toCopy
- 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 int size()
VectorCollection
size
in interface VectorCollection<V extends Vec>
public VectorCollection<V> clone()
public void add(V v)
Copyright © 2017. All rights reserved.