Class AGNES.Instance

    • Constructor Detail

      • Instance

        public Instance​(Linkage linkage)
        Constructor.
        Parameters:
        linkage - Linkage
    • Method Detail

      • findMerge

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

        protected void merge​(double mindist,
                             int x,
                             int y)
        Execute the cluster merge.
        Parameters:
        mindist - Distance that was used for merging
        x - First matrix position
        y - Second matrix position
      • updateMatrix

        protected void updateMatrix​(double mindist,
                                    int x,
                                    int y,
                                    int sizex,
                                    int sizey)
        Update the scratch distance matrix.
        Parameters:
        mindist - Minimum distance
        x - First matrix position
        y - Second matrix position
        sizex - Old size of first cluster
        sizey - Old size of second cluster
      • shrinkActiveSet

        protected static int shrinkActiveSet​(int[] clustermap,
                                             int end,
                                             int x)
        Shrink the active set: if the last x objects are all merged, we can reduce the working size accordingly.
        Parameters:
        clustermap - Map to current clusters
        end - Current active set size
        x - Last merged object
        Returns:
        New active set size