mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix bug #674: typo in documentation example for BiCGSTAB. They are now proper snippet files.
This commit is contained in:
11
doc/snippets/BiCGSTAB_simple.cpp
Normal file
11
doc/snippets/BiCGSTAB_simple.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
Reference in New Issue
Block a user