Fixed quadratic.cc documentation and code mismatch.

The hello world example, quadratic.cc and its description
in the tutorial were out of sync and led to some confusion
about the convergence behaviour. This change fixes the tex
file to match the code and discusses whats actually going
on when determining convergence.

Thanks to Nick Lewycky for reporting this.

Change-Id: Ic301d854c3f3d11e37a252e0832c00fb9e3a307c
diff --git a/docs/helloworld.tex b/docs/helloworld.tex
index 0a36229..04b677a 100644
--- a/docs/helloworld.tex
+++ b/docs/helloworld.tex
@@ -45,16 +45,13 @@
   // SimpleCostFunction and uses it to optimize the value of x.
   problem.AddResidualBlock(new SimpleCostFunction, NULL, &x);
 
-  // Configure the solver.
-  ceres::Solver::Options options;
-  options.max_num_iterations = 2;
-  // Small, simple problem so we will use the Dense QR
-  // factorization based solver.
+  // Run the solver!
+  Solver::Options options;
+  options.max_num_iterations = 10;
   options.linear_solver_type = ceres::DENSE_QR;
   options.minimizer_progress_to_stdout = true;
-
-  ceres::Solver::Summary summary;
-  ceres::Solve(options, &problem, &summary);
+  Solver::Summary summary;
+  Solve(options, &problem, &summary);
   std::cout << summary.BriefReport() << "\n";
   std::cout << "x : 5.0 -> " << x << "\n";
   return 0;
@@ -71,4 +68,4 @@
 x : 5 -> 10
 \end{minted}
 
-Starting from a $x=5$, the solver in two iterations goes to 10. The careful reader will note that this is a linear problem and one linear solve should be enough to get the optimal value.  The default configuration of the solver is aimed at non-linear problems, and for reasons of simplicity we did not change it in this example. It is indeed possible to obtain the solution to this problem using Ceres in one iteration. Also note that the solver did get very close to the optimal function value of 0 in the very first iteration. We will discuss these issues in greater detail when we talk about convergence and parameter settings for Ceres.
+Starting from a $x=5$, the solver in two iterations goes to 10~\footnote{Actually the solver ran for three iterations, and it was by looking at the value returned by the linear solver in the third iteration, it observed that the update to the parameter block was too small and declared convergence. Ceres only prints out the display at the end of an iteration, and terminates as soon as it detects convergence, which is why you only see two iterations here and not three.}. The careful reader will note that this is a linear problem and one linear solve should be enough to get the optimal value.  The default configuration of the solver is aimed at non-linear problems, and for reasons of simplicity we did not change it in this example. It is indeed possible to obtain the solution to this problem using Ceres in one iteration. Also note that the solver did get very close to the optimal function value of 0 in the very first iteration. We will discuss these issues in greater detail when we talk about convergence and parameter settings for Ceres.