[eigen] What's the best way to copy an Eigen::Vector into a std::vector? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Dear Mr. Eigen,
What's the best way to copy an Eigen::Vector into a std::vector?
I'd use
std::copy(evec.begin(), evec.end(), stdvec.begin());
if Eigen supported begin and and, but it doesn't seem to. I don't
know what Eigen's start() and end() are supposed to do, but the
following doesn't compile:
#include <algorithm>
#include <vector>
#include "Eigen/Core"
int main() {
Eigen::VectorXd evec(10);
std::vector<double> stdvec(10);
std::copy(evec.start(), evec.end(), stdvec.begin());
}
although the doxygen docs refer to start(void).
I see the headers Eigen/StdVec and Eigen/NewStdVec, but they don't
seem to do what I want.
R