From c6da881849734fc8c76a151e60da3bc65ef2e2fd Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 16 Oct 2013 15:25:39 +0200 Subject: Fix bug #674: typo in documentation example for BiCGSTAB. They are now proper snippet files. --- doc/snippets/BiCGSTAB_simple.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/snippets/BiCGSTAB_simple.cpp (limited to 'doc/snippets/BiCGSTAB_simple.cpp') diff --git a/doc/snippets/BiCGSTAB_simple.cpp b/doc/snippets/BiCGSTAB_simple.cpp new file mode 100644 index 000000000..5520f4f1f --- /dev/null +++ b/doc/snippets/BiCGSTAB_simple.cpp @@ -0,0 +1,11 @@ + int n = 10000; + VectorXd x(n), b(n); + SparseMatrix A(n,n); + /* ... fill A and b ... */ + BiCGSTAB > 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 \ No newline at end of file -- cgit v1.2.3