f = sum(A, 2) ;
A = A + diag(f) ;