O
- Object typeD
- Distance typepublic class MkTabTreeIndex<O,D extends Distance<D>> extends MkTabTree<O,D> implements RangeIndex<O>, KNNIndex<O>, RKNNIndex<O>
Modifier and Type | Field and Description |
---|---|
private KNNQuery<O,D> |
knnQuery
The knn query we use internally.
|
private Relation<O> |
relation
The relation indexed.
|
distanceFunction, distanceQuery, extraIntegrityChecks
dirCapacity, dirMinimum, initialized, leafCapacity, leafMinimum
Constructor and Description |
---|
MkTabTreeIndex(Relation<O> relation,
PageFile<MkTabTreeNode<O,D>> pagefile,
DistanceQuery<O,D> distanceQuery,
DistanceFunction<O,D> distanceFunction,
int k_max)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected MkTabEntry<D> |
createNewLeafEntry(DBID id,
O object,
D parentDistance)
Creates a new leaf entry representing the specified data object in the
specified subtree.
|
boolean |
delete(DBID 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.
|
<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.
|
<S extends Distance<S>> |
getRKNNQuery(DistanceQuery<O,S> distanceQuery,
Object... hints)
Get a KNN 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 object into this index.
|
void |
insertAll(DBIDs ids)
Inserts the specified objects into this index.
|
private List<D> |
knnDistances(O object)
Returns the knn distance of the object with the specified id.
|
createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry, getLogger, initializeCapacities, insert, kNNdistanceAdjustment, preInsert, reverseKNNQuery
createHeader, getKmax, insertAll
batchNN, createEmptyRoot, distance, distance, doKNNQuery, getDistanceFactory, getDistanceFunction, getDistanceQuery, getHeight, getLeaves, getSortedEntries, getSortedEntries, toString
deleteNode, getFile, getNode, getNode, getPageFileStatistics, getPageID, getPageSize, getRoot, getRootEntry, getRootID, getRootPath, initialize, initialize, initializeFromFile, isRoot, postDelete, writeNode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPageFileStatistics
public MkTabTreeIndex(Relation<O> relation, PageFile<MkTabTreeNode<O,D>> pagefile, DistanceQuery<O,D> distanceQuery, DistanceFunction<O,D> distanceFunction, int k_max)
relation
- Relation indexedpagefile
- Page filedistanceQuery
- Distance querydistanceFunction
- Distance functionk_max
- Maximum value for kprotected MkTabEntry<D> createNewLeafEntry(DBID id, O object, D parentDistance)
object
- the data object to be represented by the new entryparentDistance
- the distance from the object to the routing object of
the parent nodeprivate List<D> knnDistances(O object)
object
- the query objectpublic void insert(DBID id)
Index
public void insertAll(DBIDs ids)
Index
public final boolean delete(DBID id)
delete
in interface Index
id
- Object to removeUnsupportedOperationException
- thrown, since deletions aren't
implemented yet.public void deleteAll(DBIDs ids)
deleteAll
in interface Index
ids
- 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)
KNNIndex
getKNNQuery
in interface KNNIndex<O>
S
- Distance typedistanceQuery
- Distance queryhints
- Hints for the optimizernull
public <S extends Distance<S>> RangeQuery<O,S> getRangeQuery(DistanceQuery<O,S> distanceQuery, Object... hints)
RangeIndex
getRangeQuery
in interface RangeIndex<O>
S
- Distance typedistanceQuery
- Distance queryhints
- Hints for the optimizernull
public <S extends Distance<S>> RKNNQuery<O,S> getRKNNQuery(DistanceQuery<O,S> distanceQuery, Object... hints)
RKNNIndex
getRKNNQuery
in interface RKNNIndex<O>
S
- Distance typedistanceQuery
- Distance queryhints
- Hints for the optimizernull
public String getLongName()
Result
getLongName
in interface Result
public String getShortName()
Result
getShortName
in interface Result