24,860
社区成员




#include <iostream>
#include <Eigen/LU>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd m(2,2),n;
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
n.setOnes();
n=m.inverse();
cout << "Here is the matrix m:\n" << m << endl;
cout << "Here is the inverse matrix of m:\n" << n << endl;
return 0;
}