Reputation: 2765
Is there a way to do an std::move, or the moral equivalent, of the data inside a dynamically sized Eigen::Matrix? I want to move the data out for use in my own API.
Upvotes: 0
Views: 736
Reputation: 18807
Since you did not clarify what you actually want to do, a more generic answer:
No, there is no way to move the data out of an Eigen::Matrix
without accessing internals of Eigen (e.g., if you inherit from Eigen::Matrix
you have access to all internal data). I will not elaborate on how to do this, since this could break anytime if the internals of Eigen change.
There are generally two "correct" ways (or a combination of those) to interact with different APIs:
.data()
function.Eigen::Map
to access that data from Eigen's side: https://eigen.tuxfamily.org/dox/group__TutorialMapClass.htmlUpvotes: 2