Tag: 特征

将数组映射回现有的特征矩阵

我想将double数组映射到现有的MatrixXd结构。 到目前为止,我已经设法将Eigen矩阵映射到一个简单的数组,但我找不到回来的方法。 void foo(MatrixXd matrix, int n){ double arrayd = new double[n*n]; // map the input matrix to an array Map(arrayd, n, n) = matrix; //do something with the array ……. // map array back to the existing matrix }