Class FlatRStarTreeIndex<O extends NumberVector>
- java.lang.Object
-
- elki.index.tree.IndexTree<N,E>
-
- elki.index.tree.spatial.rstarvariants.AbstractRStarTree<FlatRStarTreeNode,SpatialEntry,RTreeSettings>
-
- elki.index.tree.spatial.rstarvariants.flat.FlatRStarTree
-
- elki.index.tree.spatial.rstarvariants.flat.FlatRStarTreeIndex<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
DistancePriorityIndex<O>
,DynamicIndex
,Index
,KNNIndex<O>
,RangeIndex<O>
public class FlatRStarTreeIndex<O extends NumberVector> extends FlatRStarTree implements DistancePriorityIndex<O>, DynamicIndex
The common use of the flat rstar tree: indexing number vectors.- Since:
- 0.7.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
The relation we index-
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 FlatRStarTreeIndex(Relation<O> relation, PageFile<FlatRStarTreeNode> pagefile, RTreeSettings settings)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SpatialEntry
createNewLeafEntry(DBID id)
Wrap a vector as spatial point 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 real 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.flat.FlatRStarTree
bulkLoad, computeHeight, createEmptyRoot, createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry, getNode, hasOverflow, hasUnderflow, initializeFromFile
-
Methods inherited from class elki.index.tree.spatial.rstarvariants.AbstractRStarTree
adjustTree, canBulkLoad, choosePath, containedTest, createBulkLeafNodes, createNewRoot, deletePath, doExtraIntegrityChecks, findPathToObject, getHeight, getLeaves, initializeCapacities, insertEntry, insertLeaf, logStatistics, reInsert, setHeight, toString
-
Methods inherited from class elki.index.tree.IndexTree
createHeader, deleteNode, getFile, 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
The relation we index
-
-
Constructor Detail
-
FlatRStarTreeIndex
public FlatRStarTreeIndex(Relation<O> relation, PageFile<FlatRStarTreeNode> pagefile, RTreeSettings settings)
Constructor.- Parameters:
relation
- Relation to indexpagefile
- Page filesettings
- Tree settings
-
-
Method Detail
-
createNewLeafEntry
protected SpatialEntry createNewLeafEntry(DBID id)
Wrap a vector as spatial point leaf entry.- Parameters:
id
- Object DBID- Returns:
- spatial leaf
-
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<FlatRStarTreeNode,SpatialEntry>
-
insert
public final void insert(DBIDRef id)
Inserts the specified real vector object into this index.- Specified by:
insert
in interfaceDynamicIndex
- Parameters:
id
- the object id that was inserted
-
insertAll
public final 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 final boolean delete(DBIDRef id)
Description copied from interface:DynamicIndex
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, 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
-
getLogger
protected Logging getLogger()
Description copied from class:IndexTree
Get the (STATIC) logger for this class.- Overrides:
getLogger
in classFlatRStarTree
- Returns:
- the static logger
-
-