Question

This is a continuation of a previous question - mostly around the support for SpMat (or sp_mat) in the Armadillo C++ library.

When trying to invert a sparse matrix, I get the compilation error

error: no matching function for call to ‘inv(arma::SpMat<double>&)’

I'd rather not write my own matrix inversion for sp_mat unless I really have to, and I can't use the inv(arma::Mat&) prototype because the sparse matrix I will be operating on would take up hundreds of gigabytes of RAM if it were converted to a non-sparse matrix.

Also, what about

error: no matching function for call to ‘join_cols(arma::sp_mat, arma::sp_mat)’

Is sp_mat not a supported type for joining columns?

Any help would be much appreciated!

EDIT: focused question on sparse matrix inversion error. Armadillo version being used is 3.910.1

Était-ce utile?

La solution

In contrast to the previous question about vec and mat in this case, at least from looking at armadillo headers, it seems that sp_mat and mat have unrelated base types, so you can't push the sp_mat type as a parameter to inv and join_cols, I guess do to the underlying data structures. Also, since both functions needed by you are not mentioned here http://arma.sourceforge.net/docs.html#SpMat I guess the support is not there. Since i at least partially understand the need for such a bix matrix to be kept as a sparse matrix, maybe it makes sense to use alternatives like http://math.nist.gov/sparselib++/ and http://math.nist.gov/mv++/ ?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top