Submatrices and indices using Eigen

前端 未结 4 1558
[愿得一人]
[愿得一人] 2021-02-04 06:46

I\'m currently working on a MATLAB project and I\'d like to re-implement the most computational-heavy parts using C++ and Eigen. I\'d like to know if there\'s a way to perform t

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-04 07:23

    libigl has many wrappers for Eigen to make it feel more like MATLAB. In particular, there is a slice function so that you can call:

    igl::slice(A,indices,B);
    

    which is equivalent to MATLAB's

    B = A(indices)
    

提交回复
热议问题