I need to define a function that takes a const
C array and maps it into an Eigen
map. The following code gives me an error:
double data[10] = {0.0};
typedef Eigen::Map<Eigen::VectorXd> MapVec;
MapVec fun(const double* data) {
MapVec vec(data, n);
return vec;
}
If I remove const
from the function definition the code works fine. But is it possible to retain the const
without any errors?
Thanks.