Class MkCoPTree<O>

    • Field Detail

      • LOG

        private static final Logging LOG
        The logger for this class.
      • log_k

        private double[] log_k
        The values of log(1),..,log(k_max)
    • Method Detail

      • preInsert

        protected void preInsert​(MkCoPEntry entry)
        Description copied from class: IndexTree
        Performs necessary operations before inserting the specified entry.
        Overrides:
        preInsert in class IndexTree<MkCoPTreeNode<O>,​MkCoPEntry>
        Parameters:
        entry - the entry to be inserted
        Throws:
        java.lang.UnsupportedOperationException - since this operation is not supported
      • insert

        public void insert​(MkCoPEntry entry,
                           boolean withPreInsert)
        Description copied from class: AbstractMTree
        Inserts the specified object into this M-Tree.
        Overrides:
        insert in class AbstractMTree<O,​MkCoPTreeNode<O>,​MkCoPEntry,​MkTreeSettings<O,​MkCoPTreeNode<O>,​MkCoPEntry>>
        Parameters:
        entry - the entry to be inserted
        withPreInsert - if this flag is true, the preInsert method will be called before inserting the object
        Throws:
        java.lang.UnsupportedOperationException - since this operation is not supported
      • getKmax

        public int getKmax()
        Returns the value of the k_max parameter.
        Returns:
        the value of the k_max parameter
      • doReverseKNNQuery

        private void doReverseKNNQuery​(int k,
                                       DBIDRef q,
                                       ModifiableDoubleDBIDList result,
                                       ModifiableDBIDs candidates)
        Performs a reverse knn query.
        Parameters:
        k - the parameter k of the rknn query
        q - the id of the query object
        result - holds the true results (they need not to be refined)
        candidates - holds possible candidates for the result (they need a refinement)
      • adjustApproximatedKNNDistances

        private void adjustApproximatedKNNDistances​(MkCoPEntry entry,
                                                    java.util.Map<DBID,​KNNList> knnLists)
        Adjusts the knn distance in the subtree of the specified root entry.
        Parameters:
        entry - the root entry of the current subtree
        knnLists - a map of knn lists for each leaf entry
      • ssqerr

        private double ssqerr​(int k0,
                              int kmax,
                              double[] logk,
                              double[] log_kDist,
                              double m,
                              double t)
      • optimize

        private double optimize​(int k0,
                                int kmax,
                                double sumx,
                                double sumx2,
                                double xp,
                                double yp,
                                double sumxy,
                                double sumy)
      • approximateKnnDistances

        private void approximateKnnDistances​(MkCoPLeafEntry entry,
                                             KNNList knnDistances)
        Computes logarithmic skew (fractal dimension ie. m) and in kappx[0] and kappx[1] the non-logarithmic values of the approximated first and last nearest neighbor distances
        Parameters:
        knnDistances - TODO: Spezialbehandlung fuer identische Punkte in DB (insbes. Distanz 0)
      • approximateLowerHull

        private ApproximationLine approximateLowerHull​(ConvexHull convexHull,
                                                       double[] log_k,
                                                       double sum_log_k,
                                                       double sum_log_k2,
                                                       double[] log_kDist,
                                                       double sum_log_kDist,
                                                       double sum_log_k_kDist)
        Approximates the lower hull.
        Parameters:
        convexHull -
        log_kDist -
        sum_log_kDist -
        sum_log_k_kDist -
      • approximateUpperHull

        private ApproximationLine approximateUpperHull​(ConvexHull convexHull,
                                                       double[] log_k,
                                                       double[] log_kDist)
      • approximateUpperHullPaper

        private ApproximationLine approximateUpperHullPaper​(ConvexHull convexHull,
                                                            double[] log_k,
                                                            double sum_log_k,
                                                            double sum_log_k2,
                                                            double[] log_kDist,
                                                            double sum_log_kDist,
                                                            double sum_log_k_kDist)
      • approximateUpperHullOld

        private ApproximationLine approximateUpperHullOld​(ConvexHull convexHull,
                                                          double[] log_k,
                                                          double sum_log_k,
                                                          double sum_log_k2,
                                                          double[] log_kDist,
                                                          double sum_log_kDist,
                                                          double sum_log_k_kDist)