3 ms·
Taking rows and columns is still nice in Eigen. For example taking the second column of a matrix is m.col(1) (Eigen, 0-based indexing) and m(:,2) (Fortran, 1-ba
by sampo 7y ago
Taking rows and columns is still nice in Eigen. For example taking the second column of a matrix is m.col(1) (Eigen, 0-based indexing) and m(:,2) (Fortran, 1-based indexing unless specified something else).
But more generic array slicing with strides seems to get nasty in Eigen. For example if
v2 = v(1:2:20)
is
Map<RowVectorXf,0,InnerStride<2> > v2(v.data(), v.size()/2);
in Eigen, I don't want to read the docs for how to do the same for 2- or 3-dimensional arrays.
https://eigen.tuxfamily.org/dox/group__TutorialReshapeSlicing.html https://eigen.tuxfamily.org/dox/group__TutorialReshapeSlicin...