00001 Matrix3f A(3,3); 00002 A << 1,2,3, 4,5,6, 7,8,10; 00003 PartialPivLU<Matrix3f> luOfA(A); // compute LU decomposition of A 00004 Vector3f b; 00005 b << 3,3,4; 00006 Vector3f x; 00007 x = luOfA.solve(b); 00008 cout << "The solution with right-hand side (3,3,4) is:" << endl; 00009 cout << x << endl; 00010 b << 1,1,1; 00011 x = luOfA.solve(b); 00012 cout << "The solution with right-hand side (1,1,1) is:" << endl; 00013 cout << x << endl;