Package elki.index.tree.metrical.vptree
Class GNAT.GNATPrioritySearcher<T>
- java.lang.Object
-
- elki.index.tree.metrical.vptree.GNAT.GNATPrioritySearcher<T>
-
- Type Parameters:
T
- Query object
- All Implemented Interfaces:
DBIDIter
,DBIDRef
,KNNSearcher<T>
,PrioritySearcher<T>
,RangeSearcher<T>
,Iter
- Direct Known Subclasses:
GNAT.GNATPriorityDBIDSearcher
,GNAT.GNATPriorityObjectSearcher
public abstract class GNAT.GNATPrioritySearcher<T> extends java.lang.Object implements PrioritySearcher<T>
priority search query for mvp-tree- Author:
- Robert Gehde
-
-
Field Summary
Fields Modifier and Type Field Description private GNAT.PrioritySearchBranch
cur
Current search position.private ComparableMinHeap<GNAT.PrioritySearchBranch>
heap
Min heap for searching.private double
threshold
Stopping threshold.
-
Constructor Summary
Constructors Constructor Description GNATPrioritySearcher()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PrioritySearcher<T>
advance()
Moves the iterator forward to the next entry.double
allLowerBound()
Lower bound for all subsequent instances (that have been completely explored).double
computeExactDistance()
Compute the exact distance to the current candidate.PrioritySearcher<T>
decreaseCutoff(double threshold)
Decrease the cutoff threshold.protected PrioritySearcher<T>
doSearch()
Start the next search.double
getLowerBound()
Get the lower bound (if available).int
internalGetIndex()
Internal only: Get the internal index.protected abstract double
queryDistance(DBIDRef iter)
Query the distance to a query object.boolean
valid()
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, search
-
Methods inherited from interface elki.database.query.range.RangeSearcher
getRange
-
-
-
-
Field Detail
-
heap
private ComparableMinHeap<GNAT.PrioritySearchBranch> heap
Min heap for searching.
-
threshold
private double threshold
Stopping threshold.
-
cur
private GNAT.PrioritySearchBranch cur
Current search position.
-
-
Method Detail
-
doSearch
protected PrioritySearcher<T> doSearch()
Start the next search.- Returns:
- Searcher
-
advance
public PrioritySearcher<T> advance()
Description copied from interface:Iter
Moves the iterator forward to the next entry.
-
internalGetIndex
public int internalGetIndex()
Description copied from interface:DBIDRef
Internal only: Get the internal index.NOT FOR PUBLIC USE - ELKI Optimization engine only.
- Specified by:
internalGetIndex
in interfaceDBIDRef
- Returns:
- Internal index
-
valid
public boolean valid()
Description copied from interface:Iter
Returns true if the iterator currently points to a valid object.
-
decreaseCutoff
public PrioritySearcher<T> decreaseCutoff(double threshold)
Description copied from interface:PrioritySearcher
Decrease the cutoff threshold.The cutoff must not be increased, as the search may have pruned some results automatically.
- Specified by:
decreaseCutoff
in interfacePrioritySearcher<T>
- Parameters:
threshold
- Threshold parameter- Returns:
- this, for chaining
-
computeExactDistance
public double computeExactDistance()
Description copied from interface:PrioritySearcher
Compute the exact distance to the current candidate.The searcher may or may not have this value already.
- Specified by:
computeExactDistance
in interfacePrioritySearcher<T>
- Returns:
- Distance
-
allLowerBound
public double allLowerBound()
Description copied from interface:PrioritySearcher
Lower 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:
allLowerBound
in interfacePrioritySearcher<T>
- Returns:
- lower bound;
0
if no guarantees (e.g., linear scan)
-
getLowerBound
public double getLowerBound()
Description copied from interface:PrioritySearcher
Get 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:
getLowerBound
in interfacePrioritySearcher<T>
- Returns:
Double.NaN
if not valid
-
queryDistance
protected abstract double queryDistance(DBIDRef iter)
Query the distance to a query object.- Parameters:
iter
- Target object- Returns:
- Distance
-
-