class_FullPivLU.cpp
Go to the documentation of this file.
00001 typedef Matrix<double, 5, 3> Matrix5x3;
00002 typedef Matrix<double, 5, 5> Matrix5x5;
00003 Matrix5x3 m = Matrix5x3::Random();
00004 cout << "Here is the matrix m:" << endl << m << endl;
00005 Eigen::FullPivLU<Matrix5x3> lu(m);
00006 cout << "Here is, up to permutations, its LU decomposition matrix:"
00007      << endl << lu.matrixLU() << endl;
00008 cout << "Here is the L part:" << endl;
00009 Matrix5x5 l = Matrix5x5::Identity();
00010 l.block<5,3>(0,0).triangularView<StrictlyLower>() = lu.matrixLU();
00011 cout << l << endl;
00012 cout << "Here is the U part:" << endl;
00013 Matrix5x3 u = lu.matrixLU().triangularView<Upper>();
00014 cout << u << endl;
00015 cout << "Let us now reconstruct the original matrix m:" << endl;
00016 cout << lu.permutationP().inverse() * l * u * lu.permutationQ().inverse() << endl;


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:30:55