This forum has been archived. All content is frozen. Please use KDE Discuss instead.

printing the non-zeros values for a row in SparseMatrix

Tags: None
(comma "," separated)
pamparana
Registered Member
Posts
18
Karma
0
I am trying to figure out how to print the non-zero values in an Eigen SparseMatrix along with the indexes. So, in matlab combined with C++ speak something like:

Code: Select all
Eigen::Sparsematrix<double> mat;
std::cout << mat(10, :) << std::endl;


This for example could print all the non-zero values in the 11th row along with their indexes. Something like:

Code: Select all
         (10,1)              6
         (10,2)             -6
         (10,3)              1
         (10,33)            -6
         (10,34)             4
         (10,65)             1


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]