Squashed 'third_party/eigen/' changes from 61d72f6..cf794d3
Change-Id: I9b814151b01f49af6337a8605d0c42a3a1ed4c72
git-subtree-dir: third_party/eigen
git-subtree-split: cf794d3b741a6278df169e58461f8529f43bce5d
diff --git a/doc/snippets/BiCGSTAB_step_by_step.cpp b/doc/snippets/BiCGSTAB_step_by_step.cpp
new file mode 100644
index 0000000..06147bb
--- /dev/null
+++ b/doc/snippets/BiCGSTAB_step_by_step.cpp
@@ -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);
\ No newline at end of file