Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/130.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 特征行复制_C++_Matrix_Eigen - Fatal编程技术网

C++ 特征行复制

C++ 特征行复制,c++,matrix,eigen,C++,Matrix,Eigen,如何在Eigen中执行行复制 此复制矩阵N次: MatrixXd m(3,2); m << 1,2,3,4,5,6; std::cout << "m:" << std::endl; std::cout << m << std::endl; MatrixXd m1 = m.replicate(2, 1); std::cout << "m1:" << std::endl; std::cout << m1

如何在Eigen中执行行复制

此复制矩阵N次:

MatrixXd m(3,2);
m << 1,2,3,4,5,6;
std::cout << "m:" << std::endl;
std::cout << m << std::endl;

MatrixXd m1 = m.replicate(2, 1);
std::cout << "m1:" << std::endl;
std::cout << m1 << std::endl;

m:
1 2
3 4
5 6

m1:
1 2
3 4
5 6
1 2
3 4
5 6
可能重复的
m2:
1 2
1 2
3 4
3 4
5 6
5 6