Class RStarTreeIndex<O extends NumberVector>
- java.lang.Object
-
- elki.index.tree.IndexTree<N,E>
-
- elki.index.tree.spatial.rstarvariants.AbstractRStarTree<N,E,S>
-
- elki.index.tree.spatial.rstarvariants.NonFlatRStarTree<RStarTreeNode,SpatialEntry,RTreeSettings>
-
- elki.index.tree.spatial.rstarvariants.rstar.RStarTree
-
- elki.index.tree.spatial.rstarvariants.rstar.RStarTreeIndex<O>
-
- Type Parameters:
O- Object type
- All Implemented Interfaces:
DistancePriorityIndex<O>,DynamicIndex,Index,KNNIndex<O>,RangeIndex<O>
public class RStarTreeIndex<O extends NumberVector> extends RStarTree implements DistancePriorityIndex<O>, DynamicIndex
The common use of the rstar tree: indexing number vectors.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class elki.index.tree.spatial.rstarvariants.AbstractRStarTree
AbstractRStarTree.Statistics
-
-
Field Summary
Fields Modifier and Type Field Description private static LoggingLOGThe appropriate logger for this index.private Relation<O>relationRelation-
Fields inherited from class elki.index.tree.spatial.rstarvariants.AbstractRStarTree
EXTRA_INTEGRITY_CHECKS, height, settings, statistics
-
Fields inherited from class elki.index.tree.IndexTree
dirCapacity, dirMinimum, initialized, leafCapacity, leafMinimum
-
-
Constructor Summary
Constructors Constructor Description RStarTreeIndex(Relation<O> relation, PageFile<RStarTreeNode> pagefile, RTreeSettings settings)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SpatialPointLeafEntrycreateNewLeafEntry(DBIDRef id)Create a new leaf entry.booleandelete(DBIDRef id)Deletes the specified object from this index.voiddeleteAll(DBIDs ids)Deletes the specified objects from this index.protected LogginggetLogger()Get the (STATIC) logger for this class.voidinitialize()Initialize the tree if the page file already existed.voidinsert(DBIDRef id)Inserts the specified reel vector object into this index.voidinsertAll(DBIDs ids)Inserts the specified objects into this index.KNNSearcher<O>kNNByObject(DistanceQuery<O> distanceQuery, int maxk, int flags)Get a KNN query object for the given distance query and k.PrioritySearcher<O>priorityByObject(DistanceQuery<O> distanceQuery, double maxradius, int flags)Get a priority search object.RangeSearcher<O>rangeByObject(DistanceQuery<O> distanceQuery, double maxradius, int flags)Get a range query object for the given distance query and k.-
Methods inherited from class elki.index.tree.spatial.rstarvariants.rstar.RStarTree
createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry
-
Methods inherited from class elki.index.tree.spatial.rstarvariants.NonFlatRStarTree
bulkLoad, computeHeight, createEmptyRoot, hasOverflow, hasUnderflow
-
Methods inherited from class elki.index.tree.spatial.rstarvariants.AbstractRStarTree
adjustTree, canBulkLoad, choosePath, containedTest, createBulkLeafNodes, createNewRoot, deletePath, doExtraIntegrityChecks, findPathToObject, getHeight, getLeaves, initializeCapacities, initializeFromFile, insertEntry, insertLeaf, logStatistics, reInsert, setHeight, toString
-
Methods inherited from class elki.index.tree.IndexTree
createHeader, deleteNode, getFile, getNode, getNode, getPageID, getPageSize, getRootEntry, getRootID, getRootPath, initialize, isRoot, postDelete, preInsert, writeNode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface elki.index.DistancePriorityIndex
priorityByDBID
-
Methods inherited from interface elki.index.Index
logStatistics
-
Methods inherited from interface elki.index.RangeIndex
rangeByDBID
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
The appropriate logger for this index.
-
relation
private Relation<O extends NumberVector> relation
Relation
-
-
Constructor Detail
-
RStarTreeIndex
public RStarTreeIndex(Relation<O> relation, PageFile<RStarTreeNode> pagefile, RTreeSettings settings)
Constructor.- Parameters:
relation- Relation to indexpagefile- Page filesettings- Tree settings
-
-
Method Detail
-
createNewLeafEntry
protected SpatialPointLeafEntry createNewLeafEntry(DBIDRef id)
Create a new leaf entry.- Parameters:
id- Object id- Returns:
- Spatial leaf entry
-
initialize
public void initialize()
Description copied from class:IndexTreeInitialize the tree if the page file already existed.- Specified by:
initializein interfaceIndex- Overrides:
initializein classIndexTree<RStarTreeNode,SpatialEntry>
-
insert
public void insert(DBIDRef id)
Inserts the specified reel vector object into this index.- Specified by:
insertin interfaceDynamicIndex- Parameters:
id- the object id that was inserted
-
insertAll
public void insertAll(DBIDs ids)
Inserts the specified objects into this index. If a bulk load mode is implemented, the objects are inserted in one bulk.- Specified by:
insertAllin interfaceDynamicIndex- Parameters:
ids- the objects to be inserted
-
delete
public boolean delete(DBIDRef id)
Deletes the specified object from this index.- Specified by:
deletein interfaceDynamicIndex- Parameters:
id- Object to remove- Returns:
- true if this index did contain the object with the specified id, false otherwise
-
deleteAll
public void deleteAll(DBIDs ids)
Description copied from interface:DynamicIndexDeletes the specified objects from this index.- Specified by:
deleteAllin interfaceDynamicIndex- Parameters:
ids- Objects to remove
-
kNNByObject
public KNNSearcher<O> kNNByObject(DistanceQuery<O> distanceQuery, int maxk, int flags)
Description copied from interface:KNNIndexGet a KNN query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
kNNByObjectin interfaceDistancePriorityIndex<O extends NumberVector>- Specified by:
kNNByObjectin interfaceKNNIndex<O extends NumberVector>- Parameters:
distanceQuery- Distance querymaxk- Maximum value of kflags- Hints for the optimizer- Returns:
- KNN Query object or
null
-
rangeByObject
public RangeSearcher<O> rangeByObject(DistanceQuery<O> distanceQuery, double maxradius, int flags)
Description copied from interface:RangeIndexGet a range query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
rangeByObjectin interfaceDistancePriorityIndex<O extends NumberVector>- Specified by:
rangeByObjectin interfaceRangeIndex<O extends NumberVector>- Parameters:
distanceQuery- Distance querymaxradius- Maximum rangeflags- Hints for the optimizer- Returns:
- KNN Query object or
null
-
priorityByObject
public PrioritySearcher<O> priorityByObject(DistanceQuery<O> distanceQuery, double maxradius, int flags)
Description copied from interface:DistancePriorityIndexGet a priority search object.- Specified by:
priorityByObjectin interfaceDistancePriorityIndex<O extends NumberVector>- Parameters:
distanceQuery- Distance querymaxradius- Maximum search range (may beDouble.POSITIVE_INFINITYflags- Optimizer hints- Returns:
- Priority searcher
-
-