1. A computer-implemented method, comprising: a. providing a data structure representing a matrix having rows representing entities and columns representing attributes of the entities; b. assigning each entity u of the entities and attribute i of the attributes an affiliation vector f u and f i respectively, the affiliation vector being indicative of the strength of affiliation of the entity or the attribute to N predefined initial clusters of cells of the matrix; c. providing a multiprocessor unit comprising streaming multiprocessors, each being configured for executing at least one respective thread block, a thread block comprising a predefined number of threads; d. determining a gradient vector of a likelihood function for finding optimal values of the affiliations vectors f u and f i , wherein the gradient vector comprises for a given attribute i a first term comprising Σ u:r u,i =1 G (f u , f i ) or Π u:r u,i =1 G (f u , f i ), where the sum and multiplication are over entities that have a dependency with the attribute i; e. initializing the first term using a predefined value and storing the initialized first term in a main memory of the multiprocessor unit; f. for each entity of the sum or the multiplication of the first term of the given attribute: launching a thread block for the entity-attribute pair (u, i); evaluating the function G(f u , f i ) using the threads of the thread block; selecting a thread of the thread block, wherein the selected thread is configured for adding or multiplying the evaluated first term of the entity to the current value of the first term in the main memory unit using an atomic operation.