1. A computer system comprising a processor and a computer readable memory unit coupled to the processor, said memory unit containing program code that when executed by the processor implements a method for partitioning the columns of a matrix A, said method comprising: providing the matrix A in a memory device of the computer system, said matrix A having n columns and m rows, n being an integer of at least 3, m being an integer of at least 1; partitioning the n columns of the matrix A into a closed group of p clusters, p being a positive integer of at least 2 and less than n, said partitioning comprising an affinity-based merging of clusters of pairs of clusters of the matrix A based on an affinity between the clusters in each pair of clusters being merged, each said cluster consisting of one or more columns of said matrix A, and storing the p clusters in a computer-readable storage device.