Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在本征中,我需要将 MatrixXf 放置到现有数组中。现在,这有效:
MatrixXf Um=FFMatBas(xi,CalcMetod); Map<VectorXf>Uv(Um.data(),ppp); Map<VectorXf>(Q,ppp)=Uv;
但它似乎有点复杂(Q 是一个现有的长度 ppp 数组)。我们可以一步完成最后两行吗?
MatrixXf Um=FFMatBas(xi,CalcMetod); Map<VectorXf>(Q,ppp)=Map<VectorXf>Uv(Um.data(),ppp);
假设 Q 大到足以包含矩阵,您也可以将其写为:
MatrixXf Um = FFMatBas(xi,CalcMetod); Map<MatrixXf>(Q, Um.rows(), Um.cols()) = Um;