Registered Member
|
I have a question, in MATLAB there is a spdiags function, creates sparse matrix by taking diagonal matrices, for example A = spdiags(B,d,m,n) creates an m-by-n sparse matrix by taking the columns of B and placing them along the diagonals specified by d. Is there any C++ codes has this function, or is any C++ library or class to do the same thing as this function do? or is it possible with Eigen and how?
|
Moderator
|
This is already possible from a diagonal matrix to a sparse matrix simply using operator=. For band matrices, it could be easily implemented through a conversion operator from Eigen::BandMatrix to Eigen::SparseMatrix.
|
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]