Class EuclideanRStarTreeDistancePrioritySearcher<O extends SpatialComparable>
- java.lang.Object
-
- elki.index.tree.spatial.rstarvariants.query.EuclideanRStarTreeDistancePrioritySearcher<O>
-
- All Implemented Interfaces:
DBIDIter,DBIDRef,KNNSearcher<O>,PrioritySearcher<O>,RangeSearcher<O>,Iter
public class EuclideanRStarTreeDistancePrioritySearcher<O extends SpatialComparable> extends java.lang.Object implements PrioritySearcher<O>
Instance of priority search for a particular spatial index.- Since:
- 0.8.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intchildnrCandidate within nodeprivate doublemindistDistance to current node(package private) AbstractRStarTreeNode<?,?>nodeCurrent node(package private) DoubleIntegerMinHeappqPriority queue(package private) OqueryQuery objectprotected Relation<? extends O>relationRelation we query.private static SquaredEuclideanDistanceSQUAREDSquared Euclidean distance function.(package private) doublethresholdStopping distance thresholdprotected AbstractRStarTree<?,?,?>treeThe index to use
-
Constructor Summary
Constructors Constructor Description EuclideanRStarTreeDistancePrioritySearcher(AbstractRStarTree<?,?,?> tree, Relation<? extends O> relation)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EuclideanRStarTreeDistancePrioritySearcher<O>advance()Moves the iterator forward to the next entry.protected booleanadvanceQueue()Expand the next node of the priority heap.doubleallLowerBound()Lower bound for all subsequent instances (that have been completely explored).doublecomputeExactDistance()Compute the exact distance to the current candidate.EuclideanRStarTreeDistancePrioritySearcher<O>decreaseCutoff(double threshold)Decrease the cutoff threshold.doublegetLowerBound()Get the lower bound (if available).intinternalGetIndex()Internal only: Get the internal index.EuclideanRStarTreeDistancePrioritySearcher<O>search(O query)Start search with a new object.booleanvalid()Returns true if the iterator currently points to a valid object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.database.query.PrioritySearcher
getApproximateAccuracy, getApproximateDistance, getKNN, getRange, getUpperBound, search
-
Methods inherited from interface elki.database.query.range.RangeSearcher
getRange
-
-
-
-
Field Detail
-
tree
protected final AbstractRStarTree<?,?,?> tree
The index to use
-
SQUARED
private static final SquaredEuclideanDistance SQUARED
Squared Euclidean distance function.
-
relation
protected Relation<? extends O extends SpatialComparable> relation
Relation we query.
-
query
O extends SpatialComparable query
Query object
-
threshold
double threshold
Stopping distance threshold
-
pq
DoubleIntegerMinHeap pq
Priority queue
-
node
AbstractRStarTreeNode<?,?> node
Current node
-
childnr
int childnr
Candidate within node
-
mindist
private double mindist
Distance to current node
-
-
Constructor Detail
-
EuclideanRStarTreeDistancePrioritySearcher
public EuclideanRStarTreeDistancePrioritySearcher(AbstractRStarTree<?,?,?> tree, Relation<? extends O> relation)
Constructor.- Parameters:
tree- Index to userelation- Data relation to query
-
-
Method Detail
-
search
public EuclideanRStarTreeDistancePrioritySearcher<O> search(O query)
Description copied from interface:PrioritySearcherStart search with a new object.- Specified by:
searchin interfacePrioritySearcher<O extends SpatialComparable>- Parameters:
query- Query object- Returns:
this, for chaining
-
decreaseCutoff
public EuclideanRStarTreeDistancePrioritySearcher<O> decreaseCutoff(double threshold)
Description copied from interface:PrioritySearcherDecrease the cutoff threshold.The cutoff must not be increased, as the search may have pruned some results automatically.
- Specified by:
decreaseCutoffin interfacePrioritySearcher<O extends SpatialComparable>- Parameters:
threshold- Threshold parameter- Returns:
- this, for chaining
-
valid
public boolean valid()
Description copied from interface:IterReturns true if the iterator currently points to a valid object.
-
advance
public EuclideanRStarTreeDistancePrioritySearcher<O> advance()
Description copied from interface:IterMoves the iterator forward to the next entry.- Specified by:
advancein interfaceDBIDIter- Specified by:
advancein interfaceIter- Specified by:
advancein interfacePrioritySearcher<O extends SpatialComparable>- Returns:
- The iterator itself.
-
advanceQueue
protected boolean advanceQueue()
Expand the next node of the priority heap.
-
getLowerBound
public double getLowerBound()
Description copied from interface:PrioritySearcherGet the lower bound (if available).Note: the lower bound is already checked by the cutoff of the priority search, so this is primarily useful for analyzing the search behavior.
- Specified by:
getLowerBoundin interfacePrioritySearcher<O extends SpatialComparable>- Returns:
Double.NaNif not valid
-
allLowerBound
public double allLowerBound()
Description copied from interface:PrioritySearcherLower bound for all subsequent instances (that have been completely explored). The searcher guarantees that no further results will be returned with a distance less than this.- Specified by:
allLowerBoundin interfacePrioritySearcher<O extends SpatialComparable>- Returns:
- lower bound;
0if no guarantees (e.g., linear scan)
-
computeExactDistance
public double computeExactDistance()
Description copied from interface:PrioritySearcherCompute the exact distance to the current candidate.The searcher may or may not have this value already.
- Specified by:
computeExactDistancein interfacePrioritySearcher<O extends SpatialComparable>- Returns:
- Distance
-
internalGetIndex
public int internalGetIndex()
Description copied from interface:DBIDRefInternal only: Get the internal index.NOT FOR PUBLIC USE - ELKI Optimization engine only.
- Specified by:
internalGetIndexin interfaceDBIDRef- Returns:
- Internal index
-
-