blob: 8c8829fd3a0125f2b2941428ed0e1f8de481cab9 [file] [log] [blame]
Gael Guennebaudc6da8812013-10-16 15:25:39 +02001 int n = 10000;
2 VectorXd x(n), b(n);
3 SparseMatrix<double> A(n,n);
4 /* ... fill A and b ... */
5 BiCGSTAB<SparseMatrix<double> > solver;
6 solver.compute(A);
7 x = solver.solve(b);
8 std::cout << "#iterations: " << solver.iterations() << std::endl;
9 std::cout << "estimated error: " << solver.error() << std::endl;
10 /* ... update b ... */
Aaron Franke5c22c7a2020-03-21 21:30:06 -040011 x = solver.solve(b); // solve again