def __init__(self, x_init, fun, search_direction, line_search,<EOL>convergence_condition, stop_loss_condition, anagrad=False,<EOL>epsilon=<NUM_LIT>, verbose=True, callback=None,<EOL>initial_step_size=<NUM_LIT:1.0>, constraints=None, debug_line=False):
if len(x_init.shape)!=<NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>self.x = x_init.copy()<EOL>if isinstance(fun, Preconditioner):<EOL><INDENT>self.prec = fun<EOL><DEDENT>else:<EOL><INDENT>self.prec = None<EOL><DEDENT>self.fun = FunWrapper(fun, anagrad, epsilon)<EOL>self.line = LineWrapper(fun, anagrad, epsilon)<EOL>self.search_direction = search_direction<EOL>self.line_search = line_search<EOL>self.convergence_condition = convergence_condition<EOL>self.stop_loss_condition = stop_loss_condition<EOL>self.epsilon = epsilon<EOL>self.verbose = verbose<EOL>self.callback = callback<EOL>self.initial_step_size = initial_step_size<EOL>self.constraints = constraints<EOL>self.debug_line = debug_line<EOL>self.search_direction.reset()<EOL>if self.stop_loss_condition is not None:<EOL><INDENT>self.stop_loss_condition.reset()<EOL><DEDENT>self.f = None<EOL>self.gradient = None<EOL>self.step = None<EOL>if self.convergence_condition is not None:<EOL><INDENT>self.success = self._run()<EOL><DEDENT>
Arguments:
 | ``x_init``  --  the initial guess for the minimum
 | ``fun``  --  function to be minimized (see below)
 | ``search_direction``  --  a SearchDirection object
 | ``line_search``  --  a LineSearch object
 | ``convergence_condition``  --  a ConvergenceCondition object
 | ``stop_loss_condition``  --  a StopLossCondition object

Optional arguments:
 | ``anagrad``  --  when set to True, analytical gradients are used
 | ``epsilon``  --  a small value compared to expected changes in the
                    unknowns [default=1e-6]. it is used to compute
                    finite differences.
 | ``verbose``  --  print progress information on screen
                    [default=True]
 | ``callback``  --  optional callback routine after each iteration.
                     the callback routine gets the minimizer as first
                     and only argument. [default=None]
 | ``initial_step_size``  --  The initial step size used in the first
                              call to the line search. For later
                              line searches, the actual step size
                              found by the previous line search is
                              used as initial step size. How the
                              initial step size is used, depends on
                              the line search algorithm.
 | ``constraints``  --  An instance of the Constraints class.
 | ``debug_line``  --  If True, and when the line search fails, a
                       plot with the line function will be made with
                       matplotlib and written as
                       ``'line_failed_%s.png' % isodatetime``.

The function ``fun`` takes a mandatory argument ``x`` and an optional
argument ``do_gradient``:
 | ``x``  --  the arguments of the function to be tested
 | ``do_gradient``  --  when False, only the function value is
                        returned. when True, a 2-tuple with the
                        function value and the gradient are returned
                        [default=False]