mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
5c22c7a7de
UTF-8, LF, no BOM, and newlines at the end of files
12 lines
394 B
C++
12 lines
394 B
C++
int n = 10000;
|
|
VectorXd x(n), b(n);
|
|
SparseMatrix<double> A(n,n);
|
|
/* ... fill A and b ... */
|
|
BiCGSTAB<SparseMatrix<double> > solver;
|
|
solver.compute(A);
|
|
x = solver.solve(b);
|
|
std::cout << "#iterations: " << solver.iterations() << std::endl;
|
|
std::cout << "estimated error: " << solver.error() << std::endl;
|
|
/* ... update b ... */
|
|
x = solver.solve(b); // solve again
|