mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-02-11 18:00:51 +08:00
* renaming, e.g. LU ---> FullPivLU * split tests framework: more robust, e.g. dont generate empty tests if a number is skipped * make all remaining tests use that splitting, as needed. * Fix 4x4 inversion (see stable branch) * Transform::inverse() and geo_transform test : adapt to new inverse() API, it was also trying to instantiate inverse() for 3x4 matrices. * CMakeLists: more robust regexp to parse the version number * misc fixes in unit tests
8 lines
372 B
C++
8 lines
372 B
C++
MatrixXd A = MatrixXd::Random(3,3);
|
|
MatrixXd B = MatrixXd::Random(3,2);
|
|
cout << "Here is the invertible matrix A:" << endl << A << endl;
|
|
cout << "Here is the matrix B:" << endl << B << endl;
|
|
MatrixXd X = A.lu().solve(B);
|
|
cout << "Here is the (unique) solution X to the equation AX=B:" << endl << X << endl;
|
|
cout << "Relative error: " << (A*X-B).norm() / B.norm() << endl;
|