|
Registered Member
|
Hi Everyone,
Let's say I have a sparse matrix M and a dense vector v. The following works: VectorXd p = M*v; If I have a a sparse matrix M and a sparse matrix G, the following fails: MatrixXd Q = G.transpose()*M*G; The following, however, works: SparseMatrix<double> Qsparse = G.transpose()*M*G; MatrixXd Qdense = Qsparse; Any thoughts as to what I'm doing incorrectly? Thanks! |
|
Moderator
|
hi, the product of a sparse and dense matrix is dense while the product of two sparse matrices is unlikely to be dense, that's why it is implemented to be evaluated into a sparse matrix.
|
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]