Registered Member
|
Hello,
I wanted to do something like:
My question is that whether it is safe to push an Eigen VectorXf into an STL container? Will it make a deep copy or is it efficient to do as I have described? Alternatively, is it possible to take a Eigen Sparse Matrix object and multiply it with an STL vector? Thanks, Luca |
Moderator
|
That will do a deep copy. As a workaround you can push back an empty vector and then swap them:
This will only exchange the pointer and no extra memory allocation |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]