Class MiniMax.Instance

    • Field Detail

      • clusters

        protected it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<ModifiableDBIDs> clusters
        Map to cluster members
      • protiter

        protected DBIDArrayMIter protiter
        Iterator into prototype cache
    • Constructor Detail

      • Instance

        public Instance()
        Constructor.
    • Method Detail

      • findMerge

        protected int findMerge()
        Description copied from class: AGNES.Instance
        Perform the next merge step in AGNES.
        Overrides:
        findMerge in class AGNES.Instance
        Returns:
        the index that has disappeared, for shrinking the working set
      • merge

        protected void merge​(int x,
                             int y)
        Merges two clusters given by x, y, their points with smallest IDs, and y to keep
        Parameters:
        x - first cluster to merge
        y - second cluster to merge
      • updateMatrices

        protected void updateMatrices​(int c)
        Update the entries of the matrices that contain a distance to c, the newly merged cluster.
        Parameters:
        c - the cluster to update distances to
      • updateEntry

        protected void updateEntry​(int x,
                                   int y)
        Update entry at x,y for distance matrix distances
        Parameters:
        x - index of cluster, x > y
        y - index of cluster, y < x
      • findPrototype

        private static double findPrototype​(DistanceQuery<?> dq,
                                            DBIDs cx,
                                            DBIDs cy,
                                            DBIDVar prototype,
                                            double minMaxDist)
        Find the prototypes.
        Parameters:
        dq - Distance query
        cx - First set
        cy - Second set
        prototype - Prototype output variable
        minMaxDist - Previously best distance.
        Returns:
        New best distance
      • findPrototypeSingleton

        private static double findPrototypeSingleton​(DistanceQuery<?> dq,
                                                     DBIDs cx,
                                                     DBIDRef cy,
                                                     DBIDVar prototype)
        Find the prototypes.
        Parameters:
        dq - Distance query
        cx - First set
        cy - Singleton object
        prototype - Prototype output variable
        Returns:
        New best distance
      • findMax

        private static double findMax​(DistanceQuery<?> dq,
                                      DBIDIter i,
                                      DBIDs cy,
                                      double maxDist,
                                      double minMaxDist)
        Find the maximum distance of one object to a set.
        Parameters:
        dq - Distance query
        i - Current object
        cy - Set of candidates
        maxDist - Known maximum to others
        minMaxDist - Early stopping threshold
        Returns:
        Maximum distance