blob: 5520f4f1f058ed13dc6b13413e1c66103134e67b [file] [log] [blame]
Austin Schuh189376f2018-12-20 22:11:15 +11001 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 ... */
11 x = solver.solve(b); // solve again