Class MTreeIndex<O>

    • Field Detail

      • relation

        private Relation<O> relation
        The relation indexed.
      • distanceQuery

        protected DistanceQuery<O> distanceQuery
        The distance query.
    • Method Detail

      • initializeCapacities

        protected void initializeCapacities​(MTreeEntry exampleLeaf)
        Description copied from class: IndexTree
        Determines the maximum and minimum number of entries in a node.
        Specified by:
        initializeCapacities in class IndexTree<MTreeNode<O>,​MTreeEntry>
        Parameters:
        exampleLeaf - an object that will be stored in the index
      • createNewLeafEntry

        protected MTreeEntry createNewLeafEntry​(DBID id,
                                                O object,
                                                double parentDistance)
        Returns:
        a new MTreeLeafEntry representing the specified data object
      • insert

        public void insert​(DBIDRef id)
        Description copied from interface: DynamicIndex
        Inserts the specified object into this index.
        Specified by:
        insert in interface DynamicIndex
        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 interface DynamicIndex
        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 interface DynamicIndex
        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 interface DynamicIndex
        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 interface KNNIndex<O>
        Parameters:
        distanceQuery - Distance query
        maxk - Maximum value of k
        flags - 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!

        Specified by:
        kNNByDBID in interface KNNIndex<O>
        Parameters:
        distanceQuery - Distance query
        maxk - Maximum value of k
        flags - Hints for the optimizer
        Returns:
        KNN Query object or null
      • 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 interface RangeIndex<O>
        Parameters:
        distanceQuery - Distance query
        maxrange - Maximum range
        flags - 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 interface RangeIndex<O>
        Parameters:
        distanceQuery - Distance query
        maxradius - Maximum range
        flags - Hints for the optimizer
        Returns:
        KNN Query object or null