Class DeLiCluTreeIndex<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<DeLiCluNode,DeLiCluEntry,RTreeSettings>
-
- elki.index.tree.spatial.rstarvariants.deliclu.DeLiCluTree
-
- elki.index.tree.spatial.rstarvariants.deliclu.DeLiCluTreeIndex<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
DistancePriorityIndex<O>
,DynamicIndex
,Index
,KNNIndex<O>
,RangeIndex<O>
public class DeLiCluTreeIndex<O extends NumberVector> extends DeLiCluTree implements DistancePriorityIndex<O>, DynamicIndex
The common use of the DeLiClu 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
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 DeLiCluTreeIndex(Relation<O> relation, PageFile<DeLiCluNode> pagefile, RTreeSettings settings)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DeLiCluLeafEntry
createNewLeafEntry(DBID id)
Creates a new leaf entry representing the specified data object.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.IndexTreePath<DeLiCluEntry>
setHandled(DBIDRef id, O obj)
Marks the specified object as handled and returns the path of node ids from the root to the objects's parent.-
Methods inherited from class elki.index.tree.spatial.rstarvariants.deliclu.DeLiCluTree
createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry, getExpanded, getExpanded, setExpanded
-
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
-
relation
private Relation<O extends NumberVector> relation
The relation we index.
-
LOG
private static final Logging LOG
The appropriate logger for this index.
-
-
Constructor Detail
-
DeLiCluTreeIndex
public DeLiCluTreeIndex(Relation<O> relation, PageFile<DeLiCluNode> pagefile, RTreeSettings settings)
Constructor.- Parameters:
relation
- Relation to indexpagefile
- Page filesettings
- Tree settings
-
-
Method Detail
-
createNewLeafEntry
protected DeLiCluLeafEntry createNewLeafEntry(DBID id)
Creates a new leaf entry representing the specified data object.- Parameters:
id
- Object id
-
setHandled
public IndexTreePath<DeLiCluEntry> setHandled(DBIDRef id, O obj)
Marks the specified object as handled and returns the path of node ids from the root to the objects's parent.- Parameters:
id
- the objects id to be marked as handledobj
- the object to be marked as handled- Returns:
- the path of node ids from the root to the objects's parent
-
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<DeLiCluNode,DeLiCluEntry>
-
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)
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
-
getLogger
protected Logging getLogger()
Description copied from class:IndexTree
Get the (STATIC) logger for this class.- Overrides:
getLogger
in classDeLiCluTree
- Returns:
- the static logger
-
-