#include <iostream>
#include <Eigen/Dense>
◆ main()
10 Eigen::MatrixXd
A(2, 2);
12 std::cout <<
"Here is the input matrix A before decomposition:\n" <<
A <<
"\n";
13 std::cout <<
"[init]\n";
15 std::cout <<
"[declaration]\n";
17 std::cout <<
"Here is the input matrix A after decomposition:\n" <<
A <<
"\n";
18 std::cout <<
"[declaration]\n";
20 std::cout <<
"[matrixLU]\n";
21 std::cout <<
"Here is the matrix storing the L and U factors:\n" <<
lu.matrixLU() <<
"\n";
22 std::cout <<
"[matrixLU]\n";
24 std::cout <<
"[solve]\n";
25 Eigen::MatrixXd A0(2, 2);
29 Eigen::VectorXd
x =
lu.solve(
b);
30 std::cout <<
"Residual: " << (A0 *
x -
b).norm() <<
"\n";
31 std::cout <<
"[solve]\n";
33 std::cout <<
"[modifyA]\n";
36 std::cout <<
"Residual: " << (A0 *
x -
b).norm() <<
"\n";
37 std::cout <<
"[modifyA]\n";
39 std::cout <<
"[recompute]\n";
43 std::cout <<
"Residual: " << (A0 *
x -
b).norm() <<
"\n";
44 std::cout <<
"[recompute]\n";
46 std::cout <<
"[recompute_bis0]\n";
47 Eigen::MatrixXd A1(2, 2);
50 std::cout <<
"Here is the input matrix A1 after decomposition:\n" << A1 <<
"\n";
51 std::cout <<
"[recompute_bis0]\n";
53 std::cout <<
"[recompute_bis1]\n";
55 std::cout <<
"Residual: " << (A1 *
x -
b).norm() <<
"\n";
56 std::cout <<
"[recompute_bis1]\n";
Scalar * b
Definition: benchVecAdd.cpp:17
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
LU decomposition of a matrix with partial pivoting, and related features.
Definition: PartialPivLU.h:77
cout<< "Here is the matrix m:"<< endl<< m<< endl;Eigen::FullPivLU< Matrix5x3 > lu(m)
list x
Definition: plotDoE.py:28
References b, lu(), and plotDoE::x.
◆ init_obj