Class MkMaxTreeIndex<O>
- java.lang.Object
-
- elki.index.tree.IndexTree<N,E>
-
- elki.index.tree.metrical.MetricalIndexTree<O,N,E>
-
- elki.index.tree.metrical.mtreevariants.AbstractMTree<O,N,E,S>
-
- elki.index.tree.metrical.mtreevariants.mktrees.AbstractMkTree<O,N,E,S>
-
- elki.index.tree.metrical.mtreevariants.mktrees.AbstractMkTreeUnified<O,MkMaxTreeNode<O>,MkMaxEntry,MkTreeSettings<O,MkMaxTreeNode<O>,MkMaxEntry>>
-
- elki.index.tree.metrical.mtreevariants.mktrees.mkmax.MkMaxTree<O>
-
- elki.index.tree.metrical.mtreevariants.mktrees.mkmax.MkMaxTreeIndex<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
DynamicIndex
,Index
,KNNIndex<O>
,RangeIndex<O>
,RKNNIndex<O>
public class MkMaxTreeIndex<O> extends MkMaxTree<O> implements RangeIndex<O>, KNNIndex<O>, RKNNIndex<O>, DynamicIndex
MkMax tree- Since:
- 0.4.0
- Author:
- Elke Achtert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class elki.index.tree.metrical.mtreevariants.AbstractMTree
AbstractMTree.Statistics
-
-
Field Summary
Fields Modifier and Type Field Description private Relation<O>
relation
Relation indexed.-
Fields inherited from class elki.index.tree.metrical.mtreevariants.mktrees.AbstractMkTree
knnq
-
Fields inherited from class elki.index.tree.metrical.mtreevariants.AbstractMTree
settings, statistics
-
Fields inherited from class elki.index.tree.IndexTree
dirCapacity, dirMinimum, initialized, leafCapacity, leafMinimum
-
-
Constructor Summary
Constructors Constructor Description MkMaxTreeIndex(Relation<O> relation, PageFile<MkMaxTreeNode<O>> pagefile, MkTreeSettings<O,MkMaxTreeNode<O>,MkMaxEntry> settings)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MkMaxLeafEntry
createNewLeafEntry(DBID id, DBIDRef 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.void
initialize()
Initialize the tree if the page file already existed.void
insert(DBIDRef id)
Inserts the specified object into this index.void
insertAll(DBIDs ids)
Inserts the specified objects into this index.KNNSearcher<DBIDRef>
kNNByDBID(DistanceQuery<O> distanceQuery, int maxk, int flags)
Get a KNN query object for the given distance query and k.KNNSearcher<O>
kNNByObject(DistanceQuery<O> distanceQuery, int maxk, int flags)
Get a KNN query object for the given distance query and k.RangeSearcher<DBIDRef>
rangeByDBID(DistanceQuery<O> distanceQuery, double maxradius, int flags)
Get a range query object for the given distance query and k.RangeSearcher<O>
rangeByObject(DistanceQuery<O> distanceQuery, double maxrange, int flags)
Get a range query object for the given distance query and k.RKNNSearcher<DBIDRef>
rkNNByDBID(DistanceQuery<O> distanceQuery, int maxk, int flags)
Get a RKNN query object for the given distance query and k.RKNNSearcher<O>
rkNNByObject(DistanceQuery<O> distanceQuery, int maxk, int flags)
Get a RKNN query object for the given distance query and k.-
Methods inherited from class elki.index.tree.metrical.mtreevariants.mktrees.mkmax.MkMaxTree
createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry, getLogger, initializeCapacities, kNNdistanceAdjustment, preInsert, reverseKNNQuery
-
Methods inherited from class elki.index.tree.metrical.mtreevariants.mktrees.AbstractMkTreeUnified
createHeader, getKmax, insertAll
-
Methods inherited from class elki.index.tree.metrical.mtreevariants.mktrees.AbstractMkTree
batchNN, distance
-
Methods inherited from class elki.index.tree.metrical.mtreevariants.AbstractMTree
createEmptyRoot, distance, doExtraIntegrityChecks, getDistance, getHeight, getLeaves, getSortedEntries, insert, logStatistics, toString
-
Methods inherited from class elki.index.tree.IndexTree
deleteNode, getFile, getNode, getNode, getPageID, getPageSize, getRootEntry, getRootID, getRootPath, initialize, initializeFromFile, isRoot, postDelete, writeNode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface elki.index.Index
logStatistics
-
-
-
-
Constructor Detail
-
MkMaxTreeIndex
public MkMaxTreeIndex(Relation<O> relation, PageFile<MkMaxTreeNode<O>> pagefile, MkTreeSettings<O,MkMaxTreeNode<O>,MkMaxEntry> settings)
Constructor.- Parameters:
relation
- Relationpagefile
- Page filesettings
- Tree settings
-
-
Method Detail
-
createNewLeafEntry
protected MkMaxLeafEntry createNewLeafEntry(DBID id, DBIDRef object, double parentDistance)
- Returns:
- a new MkMaxLeafEntry representing the specified data object
-
initialize
public void initialize()
Description copied from class:IndexTree
Initialize the tree if the page file already existed.- Specified by:
initialize
in interfaceIndex
- Overrides:
initialize
in classIndexTree<MkMaxTreeNode<O>,MkMaxEntry>
-
insert
public void insert(DBIDRef id)
Description copied from interface:DynamicIndex
Inserts the specified object into this index.- Specified by:
insert
in interfaceDynamicIndex
- Parameters:
id
- the object to be inserted
-
insertAll
public void insertAll(DBIDs ids)
Description copied from interface:DynamicIndex
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 interfaceDynamicIndex
- Parameters:
ids
- the objects to be inserted
-
delete
public final boolean delete(DBIDRef id)
Throws an UnsupportedOperationException since deletion of objects is not yet supported by an M-Tree.- Specified by:
delete
in interfaceDynamicIndex
- Parameters:
id
- Object to remove- Returns:
- true if this index did contain the object, false otherwise
- Throws:
java.lang.UnsupportedOperationException
- thrown, since deletions aren't implemented yet.
-
deleteAll
public void deleteAll(DBIDs ids)
Throws an UnsupportedOperationException since deletion of objects is not yet supported by an M-Tree.- Specified by:
deleteAll
in interfaceDynamicIndex
- Parameters:
ids
- Objects to remove- Throws:
java.lang.UnsupportedOperationException
- thrown, since deletions aren't implemented yet.
-
kNNByObject
public KNNSearcher<O> kNNByObject(DistanceQuery<O> distanceQuery, int maxk, int flags)
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:
kNNByObject
in interfaceKNNIndex<O>
- Parameters:
distanceQuery
- Distance querymaxk
- Maximum value of kflags
- Hints for the optimizer- Returns:
- KNN Query object or
null
-
kNNByDBID
public KNNSearcher<DBIDRef> kNNByDBID(DistanceQuery<O> distanceQuery, int maxk, int flags)
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!
-
rangeByObject
public RangeSearcher<O> rangeByObject(DistanceQuery<O> distanceQuery, double maxrange, int flags)
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:
rangeByObject
in interfaceRangeIndex<O>
- Parameters:
distanceQuery
- Distance querymaxrange
- Maximum rangeflags
- Hints for the optimizer- Returns:
- KNN Query object or
null
-
rangeByDBID
public RangeSearcher<DBIDRef> rangeByDBID(DistanceQuery<O> distanceQuery, double maxradius, int flags)
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:
rangeByDBID
in interfaceRangeIndex<O>
- Parameters:
distanceQuery
- Distance querymaxradius
- Maximum rangeflags
- Hints for the optimizer- Returns:
- KNN Query object or
null
-
rkNNByObject
public RKNNSearcher<O> rkNNByObject(DistanceQuery<O> distanceQuery, int maxk, int flags)
Description copied from interface:RKNNIndex
Get a RKNN query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
rkNNByObject
in interfaceRKNNIndex<O>
- Parameters:
distanceQuery
- Distance querymaxk
- Maximum k for RkNN queryflags
- Hints for the optimizer- Returns:
- RKNN Query object or
null
-
rkNNByDBID
public RKNNSearcher<DBIDRef> rkNNByDBID(DistanceQuery<O> distanceQuery, int maxk, int flags)
Description copied from interface:RKNNIndex
Get a RKNN query object for the given distance query and k.This function MAY return null, when the given distance is not supported!
- Specified by:
rkNNByDBID
in interfaceRKNNIndex<O>
- Parameters:
distanceQuery
- Distance querymaxk
- Maximum k for RkNN queryflags
- Hints for the optimizer- Returns:
- RKNN Query object or
null
-
-