3 init() { std::cout <<
"[" <<
"init" <<
"]" << std::endl; }
11 using namespace Eigen;
17 cout <<
"Here is the input matrix A before decomposition:\n" << A << endl;
18 cout <<
"[init]" << endl;
20 cout <<
"[declaration]" << endl;
22 cout <<
"Here is the input matrix A after decomposition:\n" << A << endl;
23 cout <<
"[declaration]" << endl;
25 cout <<
"[matrixLU]" << endl;
26 cout <<
"Here is the matrix storing the L and U factors:\n" << lu.
matrixLU() << endl;
27 cout <<
"[matrixLU]" << endl;
29 cout <<
"[solve]" << endl;
30 MatrixXd A0(2,2); A0 << 2, -1, 1, 3;
31 VectorXd
b(2); b << 1, 2;
33 cout <<
"Residual: " << (A0 * x -
b).norm() << endl;
34 cout <<
"[solve]" << endl;
36 cout <<
"[modifyA]" << endl;
39 cout <<
"Residual: " << (A0 * x -
b).norm() << endl;
40 cout <<
"[modifyA]" << endl;
42 cout <<
"[recompute]" << endl;
46 cout <<
"Residual: " << (A0 * x -
b).norm() << endl;
47 cout <<
"[recompute]" << endl;
49 cout <<
"[recompute_bis0]" << endl;
53 cout <<
"Here is the input matrix A1 after decomposition:\n" << A1 << endl;
54 cout <<
"[recompute_bis0]" << endl;
56 cout <<
"[recompute_bis1]" << endl;
58 cout <<
"Residual: " << (A1 * x -
b).norm() << endl;
59 cout <<
"[recompute_bis1]" << endl;
PartialPivLU & compute(const EigenBase< InputType > &matrix)
LU decomposition of a matrix with partial pivoting, and related features.
Namespace containing all symbols from the Eigen library.
cout<< "Here is the matrix m:"<< endl<< m<< endl;Eigen::FullPivLU< Matrix5x3 > lu(m)
const MatrixType & matrixLU() const
const Solve< PartialPivLU, Rhs > solve(const MatrixBase< Rhs > &b) const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x