Hi all,
I am multiplying a couple of sparse matrices and it happens that the product is dense. I'd like to convert the matrix product from sparse format to dense format before doing arithmetic with it.
TMB has the function asSparseMatrix() but no dense analogue. I did come across
causing me to try
matrix<Type> dmat = asMatrix(asSEXPR(spmat));
but compile failed. I know Eigen has MatrixXd(), but it returns double instead of Type.
Multiplying a sparse-format matrix by a dense-format identity matrix gets me what I want, but certainly there is a better way...
I've attached a minimal example. Any help would be appreciated!
Mikael