T
- the type of data objects.public class LinearSearch<T> extends Object implements NearestNeighborSearch<T,T>, KNNSearch<T,T>, RNNSearch<T,T>
Constructor and Description |
---|
LinearSearch(T[] dataset,
Distance<T> distance)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isIdenticalExcluded()
Get whether if query object self be excluded from the neighborhood.
|
Neighbor<T,T>[] |
knn(T q,
int k)
Search the k nearest neighbors to the query.
|
Neighbor<T,T> |
nearest(T q)
Search the nearest neighbor to the given sample.
|
void |
range(T q,
double radius,
List<Neighbor<T,T>> neighbors)
Search the neighbors in the given radius of query object, i.e.
|
void |
setIdenticalExcluded(boolean excluded)
Set if exclude query object self from the neighborhood.
|
String |
toString() |
public void setIdenticalExcluded(boolean excluded)
public boolean isIdenticalExcluded()
public Neighbor<T,T> nearest(T q)
NearestNeighborSearch
nearest
in interface NearestNeighborSearch<T,T>
q
- the query key.public Neighbor<T,T>[] knn(T q, int k)
KNNSearch
Copyright © 2015. All rights reserved.