de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rstar
Class RStarTreeIndex<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<RStarTreeNode,SpatialEntry>
                  extended by de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rstar.RStarTree
                      extended by de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rstar.RStarTreeIndex<O>
Type Parameters:
O - Object type
All Implemented Interfaces:
Index, KNNIndex<O>, RangeIndex<O>, Result

public class RStarTreeIndex<O extends NumberVector<?,?>>
extends RStarTree
implements RangeIndex<O>, KNNIndex<O>

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


Field Summary
private static Logging logger
          The appropriate logger for this index.
private  Relation<O> relation
          Relation
 
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
RStarTreeIndex(Relation<O> relation, PageFile<RStarTreeNode> pagefile, BulkSplit bulkSplitter, InsertionStrategy insertionStrategy)
          Constructor.
 
Method Summary
protected  SpatialPointLeafEntry createNewLeafEntry(DBID id)
          Create a new leaf entry.
 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 reel vector object into this index.
 void insertAll(DBIDs ids)
          Inserts the specified objects into this index.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.tree.spatial.rstarvariants.rstar.RStarTree
createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry
 
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

logger

private static final Logging logger
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,
                      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 SpatialPointLeafEntry createNewLeafEntry(DBID id)
Create a new leaf entry.

Parameters:
id - Object id
Returns:
Spatial leaf entry

insert

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

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

delete

public 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 RStarTree
Returns:
the static logger

Release 0.4.0 (2011-09-20_1324)