Class MkCoPTreeIndex<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,MkCoPTreeNode<O>,MkCoPEntry,MkTreeSettings<O,MkCoPTreeNode<O>,MkCoPEntry>>
-
- elki.index.tree.metrical.mtreevariants.mktrees.mkcop.MkCoPTree<O>
-
- elki.index.tree.metrical.mtreevariants.mktrees.mkcop.MkCoPTreeIndex<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
Index
,KNNIndex<O>
,RangeIndex<O>
,RKNNIndex<O>
public class MkCoPTreeIndex<O> extends MkCoPTree<O> implements RangeIndex<O>, KNNIndex<O>, RKNNIndex<O>
MkCoPTree used as database index.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
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 MkCoPTreeIndex(Relation<O> relation, PageFile<MkCoPTreeNode<O>> pageFile, MkTreeSettings<O,MkCoPTreeNode<O>,MkCoPEntry> settings)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MkCoPEntry
createNewLeafEntry(DBID id, O object, double parentDistance)
Creates a new leaf entry representing the specified data object in the specified subtree.void
initialize()
Initialize the tree if the page file already existed.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.mkcop.MkCoPTree
createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry, getKmax, getLogger, initializeCapacities, insert, insertAll, preInsert, reverseKNNQuery
-
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, logStatistics, toString
-
Methods inherited from class elki.index.tree.IndexTree
createHeader, 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
-
MkCoPTreeIndex
public MkCoPTreeIndex(Relation<O> relation, PageFile<MkCoPTreeNode<O>> pageFile, MkTreeSettings<O,MkCoPTreeNode<O>,MkCoPEntry> settings)
Constructor.- Parameters:
relation
- Relation to index.pageFile
- Page filesettings
- Tree settings
-
-
Method Detail
-
createNewLeafEntry
protected MkCoPEntry createNewLeafEntry(DBID id, O object, double parentDistance)
Creates a new leaf entry representing the specified data object in the specified subtree.- Parameters:
object
- the data object to be represented by the new entryparentDistance
- the distance from the object to the routing object of the parent node
-
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<MkCoPTreeNode<O>,MkCoPEntry>
-
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
-
-