|
||||||||||
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,DoubleDistance> de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.query.DoubleDistanceRStarTreeKNNQuery<O>
public class DoubleDistanceRStarTreeKNNQuery<O extends SpatialComparable>
Instance of a KNN query for a particular spatial index.
Nested Class Summary | |
---|---|
(package private) class |
DoubleDistanceRStarTreeKNNQuery.DoubleDistanceEntry
Optimized double distance entry implementation. |
Field Summary | |
---|---|
protected SpatialPrimitiveDoubleDistanceFunction<? super O> |
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 | |
---|---|
DoubleDistanceRStarTreeKNNQuery(AbstractRStarTree<?,?> tree,
DistanceQuery<O,DoubleDistance> distanceQuery,
SpatialPrimitiveDoubleDistanceFunction<? super O> distanceFunction)
Constructor. |
Method Summary | |
---|---|
protected void |
batchNN(AbstractRStarTreeNode<?,?> node,
Map<DBID,KNNHeap<DoubleDistance>> knnLists)
Performs a batch knn query. |
protected void |
doKNNQuery(O object,
KNNHeap<DoubleDistance> knnList)
Performs a k-nearest neighbor query for the given NumberVector with the given parameter k and the according distance function. |
DoubleDistance |
getDistanceFactory()
Get the distance data type of the function. |
List<List<DistanceResultPair<DoubleDistance>>> |
getKNNForBulkDBIDs(ArrayDBIDs ids,
int k)
Bulk query method |
void |
getKNNForBulkHeaps(Map<DBID,KNNHeap<DoubleDistance>> heaps)
Bulk query method configured by a map. |
List<DistanceResultPair<DoubleDistance>> |
getKNNForDBID(DBID id,
int k)
Get the k nearest neighbors for a particular id. |
List<DistanceResultPair<DoubleDistance>> |
getKNNForObject(O obj,
int k)
Get the k nearest neighbors for a particular id. |
protected List<DoubleDistanceRStarTreeKNNQuery.DoubleDistanceEntry> |
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 SpatialPrimitiveDoubleDistanceFunction<? super O extends SpatialComparable> distanceFunction
Constructor Detail |
---|
public DoubleDistanceRStarTreeKNNQuery(AbstractRStarTree<?,?> tree, DistanceQuery<O,DoubleDistance> distanceQuery, SpatialPrimitiveDoubleDistanceFunction<? super O> distanceFunction)
tree
- Index to usedistanceQuery
- Distance query to usedistanceFunction
- Distance functionMethod Detail |
---|
protected void doKNNQuery(O object, KNNHeap<DoubleDistance> knnList)
object
- the query objectknnList
- the knn list containing the resultprotected void batchNN(AbstractRStarTreeNode<?,?> node, Map<DBID,KNNHeap<DoubleDistance>> knnLists)
node
- the node for which the query should be performedknnLists
- a map containing the knn lists for each query objectsprotected List<DoubleDistanceRStarTreeKNNQuery.DoubleDistanceEntry> getSortedEntries(AbstractRStarTreeNode<?,?> node, DBIDs ids)
node
- the nodeids
- the id of the objects
public List<DistanceResultPair<DoubleDistance>> getKNNForObject(O obj, int k)
KNNQuery
getKNNForObject
in interface KNNQuery<O extends SpatialComparable,DoubleDistance>
getKNNForObject
in class AbstractDistanceKNNQuery<O extends SpatialComparable,DoubleDistance>
obj
- Query objectk
- Number of neighbors requested
public List<DistanceResultPair<DoubleDistance>> getKNNForDBID(DBID id, int k)
KNNQuery
getKNNForDBID
in interface KNNQuery<O extends SpatialComparable,DoubleDistance>
getKNNForDBID
in class AbstractDistanceKNNQuery<O extends SpatialComparable,DoubleDistance>
id
- query object IDk
- Number of neighbors requested
public List<List<DistanceResultPair<DoubleDistance>>> getKNNForBulkDBIDs(ArrayDBIDs ids, int k)
KNNQuery
ids
- query object IDsk
- Number of neighbors requested
public void getKNNForBulkHeaps(Map<DBID,KNNHeap<DoubleDistance>> heaps)
KNNQuery
heaps
- Map of heaps to fill.public DoubleDistance getDistanceFactory()
KNNQuery
getDistanceFactory
in interface KNNQuery<O extends SpatialComparable,DoubleDistance>
getDistanceFactory
in class AbstractDistanceKNNQuery<O extends SpatialComparable,DoubleDistance>
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |