I am using Eigen Sparse Matrices for the first time, and now I would like to know how to get the indices of the nonzero elements. I constructed my Sparse Matrix as follows:
Eigen::SparseMatrix<Eigen::ColMajor> Am(3,3);
and I can see some indices in VS by looking into the m_indices variable. But I can't access them. Can anyone please help me? For a Matrix like
( 1 0 1
0 1 1
0 0 0 )
I would like the indices to be like (0,0), (0,2), (1,1), (1,2)
.
Is there any way to do it?
P.S. My matrices are way bigger than 3x3.