----------------------------------------------- lines 6-63 of file: example/user/warm_start.cpp ----------------------------------------------- {xrst_begin warm_start.cpp} Warm Starting Optimization: Example and Test ############################################ Model ***** .. math:: \B{p}( z_i | \theta ) \sim \B{N} ( \theta_i , 1 ) with no prior on :math:`\theta`. The corresponding fixed likelihood :ref:`g(theta)` is .. math:: g( \theta ) = \frac{1}{2} \sum_{i} \left[ \log ( 2 \pi ) + ( z_i - \theta_i )^2 \right] We do not include the constant term :math:`\log( 2 \pi )` in the fixed likelihood. The optimal solution (with no constraints) is .. math:: \hat{\theta}_i = z_i Bounds ****** We add lower and upper bounds that are not active at the optimal solution. To be specific .. math:: 0 \leq \theta_i \leq z_i + 1 Maximum Iterations ****************** We use 5 for the maximum number of iterations so that the optimization problem does not solve on the first try. A warm start is used and the problem does solve within the limit of another 5 iterations. Optimizer Trace *************** This example uses the optimizer trace information; see :ref:`fixed_solution@trace_vec` . {xrst_literal // BEGIN C++ // END C++ } {xrst_end warm_start.cpp}