You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
393 B
11 lines
393 B
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
|