<div dir="ltr">Hello everyone,<div><br></div><div>I have a block sparse matrices A created from the DMDA3d. Before passing the matrix to ksp solver, I want to apply a transformation to this matrix: namely A:= invdiag(A)*A. Here invdiag(A) is the inverse of the block diagonal of A. What is the best way to get the transformed matrix?</div><div><br></div><div>At this moment, I created a new mat IDA=inv(diag(A)) by looping through each row and call MatMatMult to get B=invdiag(A)*A, then destroy the temporary matrix B. However, I prefer the in-place transformation if possible, namely, without the additional matrix B for memory saving purpose.</div><div><br></div><div>Do you have any suggestion on compute invdiag(A)*A for mpibaij matrix?</div><div><br></div><div>Thanks for your help.</div><div><br></div><div>Best,</div><div>Xiangdong</div><div><br></div><div><br></div><div><br></div><div> </div></div>