mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
big huge changes, so i dont remember everything.
* 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
This commit is contained in:
@@ -2,6 +2,6 @@ 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.partialLu().solve(B);
|
||||
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;
|
||||
|
||||
@@ -3,7 +3,7 @@ A << 1,2,3, 4,5,6, 7,8,10;
|
||||
Matrix<float,3,2> B;
|
||||
B << 3,1, 3,1, 4,1;
|
||||
Matrix<float,3,2> X;
|
||||
X = A.partialLu().solve(B);
|
||||
X = A.lu().solve(B);
|
||||
cout << "The solution with right-hand side (3,3,4) is:" << endl;
|
||||
cout << X.col(0) << endl;
|
||||
cout << "The solution with right-hand side (1,1,1) is:" << endl;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Matrix3f A(3,3);
|
||||
A << 1,2,3, 4,5,6, 7,8,10;
|
||||
PartialLU<Matrix3f> luOfA(A); // compute LU decomposition of A
|
||||
PartialPivLU<Matrix3f> luOfA(A); // compute LU decomposition of A
|
||||
Vector3f b;
|
||||
b << 3,3,4;
|
||||
Vector3f x;
|
||||
|
||||
@@ -5,5 +5,5 @@ b << 3, 3, 4;
|
||||
cout << "Here is the matrix A:" << endl << A << endl;
|
||||
cout << "Here is the vector b:" << endl << b << endl;
|
||||
Vector3f x;
|
||||
x = A.partialLu().solve(b);
|
||||
x = A.lu().solve(b);
|
||||
cout << "The solution is:" << endl << x << endl;
|
||||
|
||||
@@ -2,7 +2,7 @@ typedef Matrix<double, 5, 3> Matrix5x3;
|
||||
typedef Matrix<double, 5, 5> Matrix5x5;
|
||||
Matrix5x3 m = Matrix5x3::Random();
|
||||
cout << "Here is the matrix m:" << endl << m << endl;
|
||||
Eigen::LU<Matrix5x3> lu(m);
|
||||
Eigen::FullPivLU<Matrix5x3> lu(m);
|
||||
cout << "Here is, up to permutations, its LU decomposition matrix:"
|
||||
<< endl << lu.matrixLU() << endl;
|
||||
cout << "Here is the L part:" << endl;
|
||||
Reference in New Issue
Block a user