|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O> de.lmu.ifi.dbs.elki.database.query.knn.AbstractDistanceKNNQuery<O,D> de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.query.GenericRStarTreeKNNQuery<O,D>
public class GenericRStarTreeKNNQuery<O extends SpatialComparable,D extends Distance<D>>
Instance of a KNN query for a particular spatial index.
Field Summary | |
---|---|
protected SpatialPrimitiveDistanceFunction<? super O,D> |
distanceFunction
Spatial primitive distance function |
protected AbstractRStarTree<?,?> |
tree
The index to use |
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.knn.AbstractDistanceKNNQuery |
---|
distanceQuery |
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery |
---|
relation |
Fields inherited from interface de.lmu.ifi.dbs.elki.database.query.DatabaseQuery |
---|
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE |
Constructor Summary | |
---|---|
GenericRStarTreeKNNQuery(AbstractRStarTree<?,?> tree,
SpatialDistanceQuery<O,D> distanceQuery)
Constructor. |
Method Summary | |
---|---|
protected void |
batchNN(AbstractRStarTreeNode<?,?> node,
Map<DBID,KNNHeap<D>> knnLists)
Performs a batch knn query. |
protected void |
doKNNQuery(O object,
KNNHeap<D> knnList)
Performs a k-nearest neighbor query for the given NumberVector with the given parameter k and the according distance function. |
D |
getDistanceFactory()
Get the distance data type of the function. |
List<List<DistanceResultPair<D>>> |
getKNNForBulkDBIDs(ArrayDBIDs ids,
int k)
Bulk query method |
void |
getKNNForBulkHeaps(Map<DBID,KNNHeap<D>> heaps)
Bulk query method configured by a map. |
List<DistanceResultPair<D>> |
getKNNForDBID(DBID id,
int k)
Get the k nearest neighbors for a particular id. |
List<DistanceResultPair<D>> |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id. |
protected List<DistanceEntry<D,SpatialEntry>> |
getSortedEntries(AbstractRStarTreeNode<?,?> node,
DBIDs ids)
Sorts the entries of the specified node according to their minimum distance to the specified objects. |
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.knn.AbstractDistanceKNNQuery |
---|
getDistanceQuery |
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery |
---|
getRelation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.database.query.knn.KNNQuery |
---|
getRelation |
Field Detail |
---|
protected final AbstractRStarTree<?,?> tree
protected final SpatialPrimitiveDistanceFunction<? super O extends SpatialComparable,D extends Distance<D>> distanceFunction
Constructor Detail |
---|
public GenericRStarTreeKNNQuery(AbstractRStarTree<?,?> tree, SpatialDistanceQuery<O,D> distanceQuery)
tree
- Index to usedistanceQuery
- Distance query to useMethod Detail |
---|
protected void doKNNQuery(O object, KNNHeap<D> knnList)
object
- the query objectknnList
- the knn list containing the resultprotected void batchNN(AbstractRStarTreeNode<?,?> node, Map<DBID,KNNHeap<D>> knnLists)
node
- the node for which the query should be performedknnLists
- a map containing the knn lists for each query objectspublic void getKNNForBulkHeaps(Map<DBID,KNNHeap<D>> heaps)
KNNQuery
heaps
- Map of heaps to fill.protected List<DistanceEntry<D,SpatialEntry>> getSortedEntries(AbstractRStarTreeNode<?,?> node, DBIDs ids)
node
- the nodeids
- the id of the objects
public List<DistanceResultPair<D>> getKNNForObject(O obj, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O extends SpatialComparable,D extends Distance<D>>
getKNNForObject
in class AbstractDistanceKNNQuery<O extends SpatialComparable,D extends Distance<D>>
obj
- Query objectk
- Number of neighbors requested
public List<DistanceResultPair<D>> getKNNForDBID(DBID id, int k)
KNNQuery
getKNNForDBID
in interface KNNQuery<O extends SpatialComparable,D extends Distance<D>>
getKNNForDBID
in class AbstractDistanceKNNQuery<O extends SpatialComparable,D extends Distance<D>>
id
- query object IDk
- Number of neighbors requested
public List<List<DistanceResultPair<D>>> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
ids
- query object IDsk
- Number of neighbors requested
public D getDistanceFactory()
KNNQuery
getDistanceFactory
in interface KNNQuery<O extends SpatialComparable,D extends Distance<D>>
getDistanceFactory
in class AbstractDistanceKNNQuery<O extends SpatialComparable,D extends Distance<D>>
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |