Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一些简单快捷的方法可以将稀疏矩阵转换为密集的双精度矩阵?
因为我SparseMatrix的不再稀疏了,而是经过一些矩阵乘积后变得稠密了。
SparseMatrix
我还有一个问题:Eigen 库有出色的性能,这怎么可能?我不明白为什么,因为只有头文件,没有编译源。
让我们声明两个矩阵:
SparseMatrix<double> spMat; MatrixXd dMat;
稀疏到密集:
dMat = MatrixXd(spMat);
密集到稀疏:
spMat = dMat.sparseView();