Class MkTabTreeIndex<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,MkTabTreeNode<O>,MkTabEntry,MkTreeSettings<O,MkTabTreeNode<O>,MkTabEntry>>
-
- elki.index.tree.metrical.mtreevariants.mktrees.mktab.MkTabTree<O>
-
- elki.index.tree.metrical.mtreevariants.mktrees.mktab.MkTabTreeIndex<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
Index
,KNNIndex<O>
,RangeIndex<O>
,RKNNIndex<O>
public class MkTabTreeIndex<O> extends MkTabTree<O> implements RangeIndex<O>, KNNIndex<O>, RKNNIndex<O>
MkTabTree 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
The 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 MkTabTreeIndex(Relation<O> relation, PageFile<MkTabTreeNode<O>> pagefile, MkTreeSettings<O,MkTabTreeNode<O>,MkTabEntry> settings)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MkTabEntry
createNewLeafEntry(DBID id, DBIDRef 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.private double[]
knnDistances(DBIDRef object)
Returns the knn distance of the object with the specified id.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.mktab.MkTabTree
createNewDirectoryEntry, createNewDirectoryNode, createNewLeafNode, createRootEntry, getLogger, initializeCapacities, insert, 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, 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
-
MkTabTreeIndex
public MkTabTreeIndex(Relation<O> relation, PageFile<MkTabTreeNode<O>> pagefile, MkTreeSettings<O,MkTabTreeNode<O>,MkTabEntry> settings)
Constructor.- Parameters:
relation
- Relation indexedpagefile
- Page filesettings
- Tree settings
-
-
Method Detail
-
createNewLeafEntry
protected MkTabEntry createNewLeafEntry(DBID id, DBIDRef 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
-
knnDistances
private double[] knnDistances(DBIDRef object)
Returns the knn distance of the object with the specified id.- Parameters:
object
- the query object- Returns:
- the knn distance of the object with the specified id
-
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<MkTabTreeNode<O>,MkTabEntry>
-
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
-
-