de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.deliclu
Class DeLiCluTreeIndex<O extends NumberVector<?,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.tree.IndexTree<N,E>
      extended by de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialIndexTree<N,E>
          extended by de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.AbstractRStarTree<N,E>
              extended by de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.NonFlatRStarTree<DeLiCluNode,DeLiCluEntry>
                  extended by de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.deliclu.DeLiCluTree
                      extended by de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.deliclu.DeLiCluTreeIndex<O>
Type Parameters:
O - Object type
All Implemented Interfaces:
Index, KNNIndex<O>, RangeIndex<O>, Result

public class DeLiCluTreeIndex<O extends NumberVector<?,?>>
extends DeLiCluTree
implements KNNIndex<O>, RangeIndex<O>

The common use of the DeLiClu tree: indexing number vectors.


Field Summary
private static Logging logger
          The appropriate logger for this index.
private  Relation<O> relation
          The relation we index
 
Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.AbstractRStarTree
bulkSplitter, distanceCalcs, extraIntegrityChecks, height, insertionStrategy, nodeSplitter, reinsertions
 
Fields inherited from class de.lmu.ifi.dbs.elki.index.tree.IndexTree
dirCapacity, dirMinimum, initialized, leafCapacity, leafMinimum
 
Constructor Summary
DeLiCluTreeIndex(Relation<O> relation, PageFile<DeLiCluNode> pagefile, BulkSplit bulkSplitter, InsertionStrategy insertionStrategy)
          Constructor.
 
Method Summary
protected  DeLiCluLeafEntry createNewLeafEntry(DBID id)
          Creates a new leaf entry representing the specified data object.
 boolean delete(DBID id)
          Deletes the specified object from this index.
 void deleteAll(DBIDs ids)
          Deletes the specified objects from this index.
<D extends Distance<D>>
KNNQuery<O,D>
getKNNQuery(DistanceQuery<O,D> distanceQuery, Object... hints)
          Get a KNN query object for the given distance query and k.
protected  Logging getLogger()
          Get the (STATIC) logger for this class.
 String getLongName()
          A "pretty" name for the result, for use in titles, captions and menus.
<D extends Distance<D>>
RangeQuery<O,D>
getRangeQuery(DistanceQuery<O,D> distanceQuery, Object... hints)
          Get a range query object for the given distance query and k.
 String getShortName()
          A short name for the result, useful for file names.
 void insert(DBID id)
          Inserts the specified real vector object into this index.
 void insertAll(DBIDs ids)
          Inserts the specified objects into this index.
 List<TreeIndexPathComponent<DeLiCluEntry>> setHandled(DBID 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 de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.deliclu.DeLiCluTree
createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry, getExpanded, getExpanded, numNodes, setExpanded
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.NonFlatRStarTree
bulkLoad, computeHeight, createEmptyRoot, hasOverflow, hasUnderflow
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.AbstractRStarTree
adjustTree, canBulkLoad, choosePath, clearReinsertions, containedTest, createBulkLeafNodes, createNewRoot, deletePath, doExtraIntegrityChecks, findPathToObject, getHeight, getLeaves, initializeCapacities, initializeFromFile, insertDirectoryEntry, insertLeaf, insertLeafEntry, reInsert, setHeight, toString
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.IndexTree
createHeader, deleteNode, getFile, getNode, getNode, getPageFileStatistics, getPageID, getPageSize, getRoot, getRootEntry, getRootID, getRootPath, initialize, 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 de.lmu.ifi.dbs.elki.index.Index
getPageFileStatistics
 

Field Detail

relation

private Relation<O extends NumberVector<?,?>> relation
The relation we index


logger

private static final Logging logger
The appropriate logger for this index.

Constructor Detail

DeLiCluTreeIndex

public DeLiCluTreeIndex(Relation<O> relation,
                        PageFile<DeLiCluNode> pagefile,
                        BulkSplit bulkSplitter,
                        InsertionStrategy insertionStrategy)
Constructor.

Parameters:
relation - Relation to index
pagefile - Page file
bulkSplitter - bulk load strategy
insertionStrategy - the strategy to find the insertion child
Method Detail

createNewLeafEntry

protected DeLiCluLeafEntry createNewLeafEntry(DBID id)
Creates a new leaf entry representing the specified data object.

Parameters:
id - Object id

setHandled

public List<TreeIndexPathComponent<DeLiCluEntry>> setHandled(DBID 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 handled
obj - the object to be marked as handled
Returns:
the path of node ids from the root to the objects's parent

insert

public final void insert(DBID id)
Inserts the specified real vector object into this index.

Specified by:
insert in interface Index
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 interface Index
Parameters:
ids - the objects to be inserted

delete

public final boolean delete(DBID id)
Deletes the specified object from this index.

Specified by:
delete in interface Index
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: Index
Deletes the specified objects from this index.

Specified by:
deleteAll in interface Index
Parameters:
ids - Objects to remove

getRangeQuery

public <D extends Distance<D>> RangeQuery<O,D> getRangeQuery(DistanceQuery<O,D> distanceQuery,
                                                             Object... hints)
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:
getRangeQuery in interface RangeIndex<O extends NumberVector<?,?>>
Type Parameters:
D - Distance type
Parameters:
distanceQuery - Distance query
hints - Hints for the optimizer
Returns:
KNN Query object or null

getKNNQuery

public <D extends Distance<D>> KNNQuery<O,D> getKNNQuery(DistanceQuery<O,D> distanceQuery,
                                                         Object... hints)
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:
getKNNQuery in interface KNNIndex<O extends NumberVector<?,?>>
Type Parameters:
D - Distance type
Parameters:
distanceQuery - Distance query
hints - Hints for the optimizer
Returns:
KNN Query object or null

getLongName

public String getLongName()
Description copied from interface: Result
A "pretty" name for the result, for use in titles, captions and menus.

Specified by:
getLongName in interface Result
Returns:
result name

getShortName

public String getShortName()
Description copied from interface: Result
A short name for the result, useful for file names.

Specified by:
getShortName in interface Result
Returns:
result name

getLogger

protected Logging getLogger()
Description copied from class: IndexTree
Get the (STATIC) logger for this class.

Overrides:
getLogger in class DeLiCluTree
Returns:
the static logger

Release 0.4.0 (2011-09-20_1324)