Eigen::Ref for concatenating matrices
问题 If I want to concatenate two matrices A and B , I would do using Eigen::MatrixXd; const MatrixXd A(n, p); const MatrixXd B(n, q); MatrixXd X(n, p+q); X << A, B; Now if n , p , q are large, defining X in this way would mean creating copies of A and B . Is it possible to define X as an Eigen::Ref<MatrixXd> instead? Thanks. 回答1: No, Ref is not designed for that. We/You would need to define a new expression for that, that could be called Cat . If you only need to concatenate two matrices