Map two-dimensional array to Eigen::Matrix
I can't figure out if and how it's possible to map a two-dimensional double array to an Eigen::Matrix. Is it possible to map an array double d[][] which I receive as double** p to an Eigen::Matrix? While one-dimensinal arrays work fine, I wasn't able to map p to Eigen::Map<Eigen::Matrix<double, n, n>> . Is that possible and how could it be done? The size n is not really constant, but I could accept a hard coded size. I tried several versions, but none worked. I thought the following should work (assume the size n would be 4). Eigen::Map<Eigen::Matrix<double, 4, 4>> p_OUTPUT(&p[0][0]); The code