Workaround for resizing Eigen::Ref
问题 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