TutorialLinAlgComputeTwice.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include <Eigen/Dense>
00003 
00004 using namespace std;
00005 using namespace Eigen;
00006 
00007 int main()
00008 {
00009    Matrix2f A, b;
00010    LLT<Matrix2f> llt;
00011    A << 2, -1, -1, 3;
00012    b << 1, 2, 3, 1;
00013    cout << "Here is the matrix A:\n" << A << endl;
00014    cout << "Here is the right hand side b:\n" << b << endl;
00015    cout << "Computing LLT decomposition..." << endl;
00016    llt.compute(A);
00017    cout << "The solution is:\n" << llt.solve(b) << endl;
00018    A(1,1)++;
00019    cout << "The matrix A is now:\n" << A << endl;
00020    cout << "Computing LLT decomposition..." << endl;
00021    llt.compute(A);
00022    cout << "The solution is now:\n" << llt.solve(b) << endl;
00023 }


libicr
Author(s): Robert Krug
autogenerated on Mon Jan 6 2014 11:33:55