def perform_clustering(self,kwargs):
        """
        Does the actual clustering.
        """
        cutoff = kwargs["cutoff"]

        try:
            max_clusters = kwargs["max_clusters"]
        except __HOLE__:
            max_clusters = sys.maxint

        nodes = range(self.condensed_matrix.row_length)
        clusters = []
        elements_already_clustered = 0
        iteration = 0
        # Do it while there are nodes left
        while not len(nodes) == 0 and not len(clusters) >= max_clusters:
            cluster = self.__do_one_iteration(nodes,cutoff)
            clusters.append(cluster)
            elements_already_clustered = elements_already_clustered + cluster.get_size()
            if elements_already_clustered + len(nodes) > self.condensed_matrix.row_length:
                print "[ERROR :: GROMOS perform_clustering] ", elements_already_clustered + len(nodes), iteration
                exit(1)
            iteration = iteration + 1
            
        return Clustering(clusters,details="GROMOS (cutoff = "+str(cutoff)+")")
dataset/ETHPy150Open victor-gil-sepulveda/pyProCT/pyproct/clustering/algorithms/gromos/gromosAlgorithm.py/GromosAlgorithm.perform_clustering