Fix bug #674: typo in documentation example for BiCGSTAB. They are now proper snippet files.

This commit is contained in:
Gael Guennebaud
2013-10-16 15:25:39 +02:00
parent b61facb08b
commit c6da881849
4 changed files with 28 additions and 24 deletions

View File

@@ -0,0 +1,14 @@
int n = 10000;
VectorXd x(n), b(n);
SparseMatrix<double> A(n,n);
/* ... fill A and b ... */
BiCGSTAB<SparseMatrix<double> > solver(A);
// start from a random solution
x = VectorXd::Random(n);
solver.setMaxIterations(1);
int i = 0;
do {
x = solver.solveWithGuess(b,x);
std::cout << i << " : " << solver.error() << std::endl;
++i;
} while (solver.info()!=Success && i<100);