c++计算eigen随笔(5)-求转置

#include <iostream>
#include <../Eigen/Dense>
using namespace std;
using namespace  Eigen;
int main(int argc, char **argv)
{
Matrix2i m = Matrix2i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the transpose of m:" << endl << m.transpose() << endl;
cout << "Here is the coefficient (1,0) in the transpose of m:" << endl<< m.transpose()(1,0) << endl;
cout << "Let us overwrite this coefficient with the value 0." << endl;
m.transpose()(1,0) = 0;
cout << "Now the matrix m is:" << endl << m << endl;
}
Here is the matrix m:
-1073725017   548908249
 -791266575   -88798166
Here is the transpose of m:
-1073725017  -791266575
  548908249   -88798166
Here is the coefficient (1,0) in the transpose of m:
548908249
Let us overwrite this coefficient with the value 0.
Now the matrix m is:
-1073725017           0
 -791266575   -88798166
Hit any key to continue...
发布了385 篇原创文章 · 获赞 13 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/AI_LX/article/details/104331825