This should hopefully be pretty simple but i cannot find a way to do it in the Eigen documentation.
Say i have a 2D vector, ie
std::vector<std::vector<double> > data
Assume it is filled with 10 x 4
data set.
How can I use this data to fill out an Eigen::MatrixXd mat
.
The obvious way is to use a for loop like this:
#Pseudo code
Eigen::MatrixXd mat(10, 4);
for i : 1 -> 10
mat(i, 0) = data[i][0];
mat(i, 1) = data[i][1];
...
end
But there should be a better way that is native to Eigen?