I have an nxn matrix where the diagonals are all 1's and all other values are random positive values. I want to transform this into a matrix where the diagonals are the sums of the other values in their given row - for example, (1,1) is the sum of (1,2) + (1,3) + ... + (1, n). Is there any way to express this transformation in terms of only the matrix itself and the identity matrix (so not row/column vectors of 1's, etc.), using basic matrix operations (transpose, multiplication, addition, etc.)? It seems pretty similar to trying to find the Laplacian matrix of the original matrix, but I'm not sure how to express that in terms of only the matrix itself, and I've been struggling with this for several hours.