eigen3

Workaround for resizing Eigen::Ref

余生颓废 提交于 2020-12-13 11:06:38
问题 I want to use Eigen::Ref to have non-template functions using Eigen::Matrix arguments. My problem is that in these functions, I may have to resize the matrices referenced by the Eigen::Ref. I understand that for generality an Eigen::Ref should not be resized because it can map to an expression or a matrix block, but In my case, I am sure that what is behind my Eigen::Ref is an Eigen::Matrix. To illustrate this: #include "Eigen/Dense" void add(Eigen::Ref<Eigen::MatrixXd> M, const Eigen::Ref

Workaround for resizing Eigen::Ref

依然范特西╮ 提交于 2020-12-13 11:06:26
问题 I want to use Eigen::Ref to have non-template functions using Eigen::Matrix arguments. My problem is that in these functions, I may have to resize the matrices referenced by the Eigen::Ref. I understand that for generality an Eigen::Ref should not be resized because it can map to an expression or a matrix block, but In my case, I am sure that what is behind my Eigen::Ref is an Eigen::Matrix. To illustrate this: #include "Eigen/Dense" void add(Eigen::Ref<Eigen::MatrixXd> M, const Eigen::Ref

Eigen - Balancing matrix for eigenvalue

百般思念 提交于 2020-08-23 07:59:15
问题 My experience (like some others: How do I get specified Eigenvectors from the generalized Schur factorization of a matrix pair using LAPACK?) is that the eigenvalues obtained from Eigen (I don't care about the eigenvectors) are not nearly as reliable as those obtained from numpy, matlab, etc. when the matrix is ill-conditioned. The internet (https://www.mathworks.com/help/matlab/ref/balance.html) suggests that balancing is the solution, but I can't figure out how to do this in Eigen. Can