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 Logging
LOG
The appropriate logger for this index.private Relation<O>
relation
Relation-
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 SpatialPointLeafEntry
createNewLeafEntry(DBIDRef id)
Create a new leaf entry.boolean
delete(DBIDRef id)
Deletes the specified object from this index.void
deleteAll(DBIDs ids)
Deletes the specified objects from this index.protected Logging
getLogger()
Get the (STATIC) logger for this class.void
initialize()
Initialize the tree if the page file already existed.void
insert(DBIDRef id)
Inserts the specified reel vector object into this index.void
insertAll(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:IndexTree
Initialize the tree if the page file already existed.- Specified by:
initialize
in interfaceIndex
- Overrides:
initialize
in classIndexTree<RStarTreeNode,SpatialEntry>
-
insert
public void insert(DBIDRef id)
Inserts the specified reel vector object into this index.- Specified by:
insert
in 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:
insertAll
in interfaceDynamicIndex
- Parameters:
ids
- the objects to be inserted
-
delete
public boolean delete(DBIDRef id)
Deletes the specified object from this index.- Specified by:
delete
in 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:DynamicIndex
Deletes the specified objects from this index.- Specified by:
deleteAll
in interfaceDynamicIndex
- Parameters:
ids
- Objects to remove
-
kNNByObject
public KNNSearcher<O> kNNByObject(DistanceQuery<O> distanceQuery, int maxk, int flags)
Description copied from interface:KNNIndex
Get 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:
kNNByObject
in interfaceDistancePriorityIndex<O extends NumberVector>
- Specified by:
kNNByObject
in 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:RangeIndex
Get 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:
rangeByObject
in interfaceDistancePriorityIndex<O extends NumberVector>
- Specified by:
rangeByObject
in 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:DistancePriorityIndex
Get a priority search object.- Specified by:
priorityByObject
in interfaceDistancePriorityIndex<O extends NumberVector>
- Parameters:
distanceQuery
- Distance querymaxradius
- Maximum search range (may beDouble.POSITIVE_INFINITY
flags
- Optimizer hints- Returns:
- Priority searcher
-
-