Class ClusteringMatrixBuilder

java.lang.Object
ch.usi.inf.sape.hac.ClusteringMatrixBuilder
All Implemented Interfaces:
ClusteringBuilder

public final class ClusteringMatrixBuilder extends Object implements ClusteringBuilder
A ClusteringMatrixBuilder builds a matrix in which each row represents a step in the clustering and each column represents an observation or cluster. In the first step (row 0), each column represents an observation. In the last step, each column refers to the same cluster. Each step represents a copy of the step above, with two clusters merged into one.
  • Constructor Details

    • ClusteringMatrixBuilder

      public ClusteringMatrixBuilder(int nObservations)
  • Method Details

    • merge

      public void merge(int i, int j, double dissimilarity)
      Description copied from interface: ClusteringBuilder
      Merge two clusters.
      Specified by:
      merge in interface ClusteringBuilder
      Parameters:
      i - the smaller of the two cluster indices
      j - the larger of the two cluster indices
      dissimilarity - between the two merged clusters
    • getClustering

      public int[][] getClustering()