How to convert an Eigen::Matrix<double,Dynamic,Dynamic>
to an Eigen::SparseMatrix<double>
?
I'm looking for a better way instead of iterate through the dense matrix
you can use the sparseView() method for that:
sparse = dense.sparseView();
and even specify a tolerance:
sparse = dense.sparseView(epsilon,reference);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With