Using the Eigen library in C++, given a sparse matrix A, what is the most efficient way (row-wise operations? how to?) to compute a sparse matrix B such that B(i, j) = A(i, j) / A(i, i) ? That is, divide each row i by the corresponding diagonal element A(i, i).
It would be helpful to know how to do it both in-place (replacing entries in A) and out-of-place (creating a new sparse matrix B).
My sparse matrix is defined as:
typedef double Real;
typedef Eigen::SparseMatrix<Real> SparseMatrixR;
Thank you,
m.