Registered Member
|
Hi there, I'm a newbie, could you clarify this:
in .h:
in .cpp
Since the Sparse Matrices could be huge, is it better to allocate memory and use a vector of pointers to sparse matrix:
How do you think? Is the last code useless? thanks |
Moderator
|
Hi,
I see two options, 1) you push empty SparseMatrix and directly work with them, 2) you create individual SparseMatrix and then only store a vector of pointers. |
Registered Member
|
yes, the code is not complete. in the last option i would write:
I don`t understand how Eigen handles the memory. |
Moderator
|
I meant that if all you want is to create a std::vector of sparse matrices, and not aggregates existing matrices into a std::vector, then use option 1, otherwise use option 2.
|
Registered Member
|
It's clear for me.
Thanks |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]