Austin Schuh | 189376f | 2018-12-20 22:11:15 +1100 | [diff] [blame] | 1 | 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(A); |
| 6 | // start from a random solution |
| 7 | x = VectorXd::Random(n); |
| 8 | solver.setMaxIterations(1); |
| 9 | int i = 0; |
| 10 | do { |
| 11 | x = solver.solveWithGuess(b,x); |
| 12 | std::cout << i << " : " << solver.error() << std::endl; |
| 13 | ++i; |
Austin Schuh | c55b017 | 2022-02-20 17:52:35 -0800 | [diff] [blame^] | 14 | } while (solver.info()!=Success && i<100); |