
O - Object typeD - Distance typepublic class MTreeIndex<O,D extends NumberDistance<D,?>> extends MTree<O,D> implements RangeIndex<O>, KNNIndex<O>, DynamicIndex
AbstractMTree.Statistics| Modifier and Type | Field and Description |
|---|---|
protected DistanceQuery<O,D> |
distanceQuery
The distance query.
|
private Relation<O> |
relation
The relation indexed.
|
EXTRA_INTEGRITY_CHECKS, settings, statisticsdirCapacity, dirMinimum, initialized, leafCapacity, leafMinimum| Constructor and Description |
|---|
MTreeIndex(Relation<O> relation,
PageFile<MTreeNode<O,D>> pagefile,
MTreeSettings<O,D,MTreeNode<O,D>,MTreeEntry> settings)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected MTreeEntry |
createNewLeafEntry(DBID id,
O object,
double parentDistance) |
boolean |
delete(DBIDRef id)
Throws an UnsupportedOperationException since deletion of objects is not
yet supported by an M-Tree.
|
void |
deleteAll(DBIDs ids)
Throws an UnsupportedOperationException since deletion of objects is not
yet supported by an M-Tree.
|
D |
distance(DBIDRef id1,
DBIDRef id2)
Returns the distance between the two specified ids.
|
<S extends Distance<S>> |
getKNNQuery(DistanceQuery<O,S> distanceQuery,
Object... hints)
Get a KNN query object for the given distance query and k.
|
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
<S extends Distance<S>> |
getRangeQuery(DistanceQuery<O,S> 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 |
initialize()
Initialize the tree if the page file already existed.
|
protected void |
initializeCapacities(MTreeEntry exampleLeaf)
Determines the maximum and minimum number of entries in a node.
|
void |
insert(DBIDRef id)
Inserts the specified object into this index.
|
void |
insertAll(DBIDs ids)
Inserts the specified objects into this index.
|
createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry, getLogger, preInsertcreateEmptyRoot, distance, getDistanceFactory, getDistanceFunction, getHeight, getLeaves, getSortedEntries, insert, insertAll, logStatistics, toStringcreateHeader, deleteNode, getFile, getNode, getNode, getPageID, getPageSize, getRoot, getRootEntry, getRootID, getRootPath, initialize, initializeFromFile, isRoot, postDelete, writeNodeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitlogStatisticsprotected DistanceQuery<O,D extends NumberDistance<D,?>> distanceQuery
public D distance(DBIDRef id1, DBIDRef id2)
AbstractMTreedistance in class AbstractMTree<O,D extends NumberDistance<D,?>,MTreeNode<O,D extends NumberDistance<D,?>>,MTreeEntry,MTreeSettings<O,D extends NumberDistance<D,?>,MTreeNode<O,D extends NumberDistance<D,?>>,MTreeEntry>>id1 - the first idid2 - the second idprotected void initializeCapacities(MTreeEntry exampleLeaf)
IndexTreeinitializeCapacities in class IndexTree<MTreeNode<O,D extends NumberDistance<D,?>>,MTreeEntry>exampleLeaf - an object that will be stored in the indexprotected MTreeEntry createNewLeafEntry(DBID id, O object, double parentDistance)
public void initialize()
IndexTreeinitialize in interface Indexinitialize in class IndexTree<MTreeNode<O,D extends NumberDistance<D,?>>,MTreeEntry>public void insert(DBIDRef id)
DynamicIndexinsert in interface DynamicIndexid - the object to be insertedpublic void insertAll(DBIDs ids)
DynamicIndexinsertAll in interface DynamicIndexids - the objects to be insertedpublic final boolean delete(DBIDRef id)
delete in interface DynamicIndexid - Object to removeUnsupportedOperationException - thrown, since deletions aren't
implemented yet.public void deleteAll(DBIDs ids)
deleteAll in interface DynamicIndexids - Objects to removeUnsupportedOperationException - thrown, since deletions aren't
implemented yet.public <S extends Distance<S>> KNNQuery<O,S> getKNNQuery(DistanceQuery<O,S> distanceQuery, Object... hints)
KNNIndexgetKNNQuery in interface KNNIndex<O>S - Distance typedistanceQuery - Distance queryhints - Hints for the optimizernullpublic <S extends Distance<S>> RangeQuery<O,S> getRangeQuery(DistanceQuery<O,S> distanceQuery, Object... hints)
RangeIndexgetRangeQuery in interface RangeIndex<O>S - Distance typedistanceQuery - Distance queryhints - Hints for the optimizernullpublic String getLongName()
ResultgetLongName in interface Resultpublic String getShortName()
ResultgetShortName in interface Result