O
- Object typepublic class MTreeIndex<O> extends MTree<O> implements RangeIndex<O>, KNNIndex<O>, DynamicIndex
AbstractMTree.Statistics
Modifier and Type | Field and Description |
---|---|
protected DistanceQuery<O> |
distanceQuery
The distance query.
|
private Relation<O> |
relation
The relation indexed.
|
EXTRA_INTEGRITY_CHECKS, settings, statistics
dirCapacity, dirMinimum, initialized, leafCapacity, leafMinimum
Constructor and Description |
---|
MTreeIndex(Relation<O> relation,
PageFile<MTreeNode<O>> pagefile,
MTreeSettings<O,MTreeNode<O>,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.
|
double |
distance(DBIDRef id1,
DBIDRef id2)
Returns the distance between the two specified ids.
|
KNNQuery<O> |
getKNNQuery(DistanceQuery<O> distanceQuery,
java.lang.Object... hints)
Get a KNN query object for the given distance query and k.
|
java.lang.String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
RangeQuery<O> |
getRangeQuery(DistanceQuery<O> distanceQuery,
java.lang.Object... hints)
Get a range query object for the given distance query and k.
|
java.lang.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, preInsert
createEmptyRoot, distance, getDistanceFunction, getHeight, getLeaves, getSortedEntries, insert, insertAll, logStatistics, toString
createHeader, deleteNode, getDirMinimum, getFile, getLeafMinimum, getNode, getNode, getPageID, getPageSize, getRoot, getRootEntry, getRootID, getRootPath, initialize, initializeFromFile, isRoot, postDelete, writeNode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
logStatistics
protected DistanceQuery<O> distanceQuery
public MTreeIndex(Relation<O> relation, PageFile<MTreeNode<O>> pagefile, MTreeSettings<O,MTreeNode<O>,MTreeEntry> settings)
relation
- Relation indexedpagefile
- Page filesettings
- Tree settingspublic double distance(DBIDRef id1, DBIDRef id2)
AbstractMTree
distance
in class AbstractMTree<O,MTreeNode<O>,MTreeEntry,MTreeSettings<O,MTreeNode<O>,MTreeEntry>>
id1
- the first idid2
- the second idprotected void initializeCapacities(MTreeEntry exampleLeaf)
IndexTree
initializeCapacities
in class IndexTree<MTreeNode<O>,MTreeEntry>
exampleLeaf
- an object that will be stored in the indexprotected MTreeEntry createNewLeafEntry(DBID id, O object, double parentDistance)
public void initialize()
IndexTree
initialize
in interface Index
initialize
in class IndexTree<MTreeNode<O>,MTreeEntry>
public void insert(DBIDRef id)
DynamicIndex
insert
in interface DynamicIndex
id
- the object to be insertedpublic void insertAll(DBIDs ids)
DynamicIndex
insertAll
in interface DynamicIndex
ids
- the objects to be insertedpublic final boolean delete(DBIDRef id)
delete
in interface DynamicIndex
id
- Object to removejava.lang.UnsupportedOperationException
- thrown, since deletions aren't
implemented yet.public void deleteAll(DBIDs ids)
deleteAll
in interface DynamicIndex
ids
- Objects to removejava.lang.UnsupportedOperationException
- thrown, since deletions aren't
implemented yet.public KNNQuery<O> getKNNQuery(DistanceQuery<O> distanceQuery, java.lang.Object... hints)
KNNIndex
getKNNQuery
in interface KNNIndex<O>
distanceQuery
- Distance queryhints
- Hints for the optimizernull
public RangeQuery<O> getRangeQuery(DistanceQuery<O> distanceQuery, java.lang.Object... hints)
RangeIndex
getRangeQuery
in interface RangeIndex<O>
distanceQuery
- Distance queryhints
- Hints for the optimizernull
public java.lang.String getLongName()
Result
getLongName
in interface Result
public java.lang.String getShortName()
Result
getShortName
in interface Result
Copyright © 2019 ELKI Development Team. License information.