Class MiniMax.Instance

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<elki.database.ids.ModifiableDBIDs> clusters
      Map to cluster members
      protected elki.database.query.distance.DistanceQuery<?> dq
      Distance query function
      protected elki.database.ids.DBIDArrayIter ix
      Iterators into the object ids.
      protected elki.database.ids.DBIDArrayIter iy
      Iterators into the object ids.
      protected elki.database.ids.DBIDArrayMIter protiter
      Iterator into prototype cache
    • Constructor Summary

      Constructors 
      Constructor Description
      Instance()
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static double findMax​(elki.database.query.distance.DistanceQuery<?> dq, elki.database.ids.DBIDIter i, elki.database.ids.DBIDs cy, double maxDist, double minMaxDist)
      Find the maximum distance of one object to a set.
      protected int findMerge()
      Perform the next merge step in AGNES.
      private static double findPrototype​(elki.database.query.distance.DistanceQuery<?> dq, elki.database.ids.DBIDs cx, elki.database.ids.DBIDs cy, elki.database.ids.DBIDVar prototype, double minMaxDist)
      Find the prototypes.
      private static double findPrototypeSingleton​(elki.database.query.distance.DistanceQuery<?> dq, elki.database.ids.DBIDs cx, elki.database.ids.DBIDRef cy, elki.database.ids.DBIDVar prototype)
      Find the prototypes.
      protected void merge​(int x, int y)
      Merges two clusters given by x, y, their points with smallest IDs, and y to keep
      ClusterMergeHistory run​(ClusterDistanceMatrix mat, ClusterMergeHistoryBuilder builder)
      Run the main algorithm.
      ClusterPrototypeMergeHistory run​(elki.database.ids.ArrayDBIDs ids, ClusterDistanceMatrix mat, ClusterMergeHistoryBuilder builder, elki.database.query.distance.DistanceQuery<?> dq, elki.database.ids.DBIDArrayMIter prots)  
      protected void updateEntry​(int x, int y)
      Update entry at x,y for distance matrix distances
      protected void updateMatrices​(int c)
      Update the entries of the matrices that contain a distance to c, the newly merged cluster.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • clusters

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

        protected elki.database.ids.DBIDArrayMIter protiter
        Iterator into prototype cache
      • dq

        protected elki.database.query.distance.DistanceQuery<?> dq
        Distance query function
      • ix

        protected elki.database.ids.DBIDArrayIter ix
        Iterators into the object ids.
      • iy

        protected elki.database.ids.DBIDArrayIter iy
        Iterators into the object ids.
    • 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​(elki.database.query.distance.DistanceQuery<?> dq,
                                            elki.database.ids.DBIDs cx,
                                            elki.database.ids.DBIDs cy,
                                            elki.database.ids.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​(elki.database.query.distance.DistanceQuery<?> dq,
                                                     elki.database.ids.DBIDs cx,
                                                     elki.database.ids.DBIDRef cy,
                                                     elki.database.ids.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​(elki.database.query.distance.DistanceQuery<?> dq,
                                      elki.database.ids.DBIDIter i,
                                      elki.database.ids.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