Registered Member
|
I have not been able to find an example of nor figured out how to efficiently initialize a sparse vector from a sparse matrix row. The sparse matrix is passed in as an argument.
What I have in my code (outline) is: vector<double> my_function( SparseMatrix<double>& link_type_matrix_new) { < do things> SparseVector<double,Dynamic> sparse_v = sparse_mat.row(index); < do more things> } The error is: error: ‘INVALID_MATRIX_TEMPLATE_PARAMETERS’ is not a member of ‘Eigen::internal::static_assertion<false> |
Moderator
|
The second template parameter of SparseVector is not its size but an option bit-flag to control wether you want a column or row vector.... So pass Dynamic is not allowed.
|
Registered Member
|
Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar