def __compute_loss_square(distance_matrix, medoids_idx, memberships, fuzzifier
    ):
    """ DEPRECATED: old method used to compute the loss.
    Much slower than the existing method.
    """
    res = 0
    n = distance_matrix.shape[0]
    for idx_medoid, medoid in enumerate(medoids_idx):
        for i in range(n):
            dist = distance_matrix[i, medoid]
            res += memberships[i][idx_medoid] ** fuzzifier * dist
    return res
