code: def opt(self, x_init, f_fp=None, f=None, fp=None):
          
          rcstrings = ['Converged', 'Maximum number of f evaluations reached', 'Error']
  
          assert f_fp != None, "BFGS requires f_fp"
  
          opt_dict = {}
          if self.xtol is not None:
              print("WARNING: l-bfgs-b doesn't have an xtol arg, so I'm going to ignore it")
          if self.ftol is not None:
              print("WARNING: l-bfgs-b doesn't have an ftol arg, so I'm going to ignore it")
          if self.gtol is not None:
              opt_dict['pgtol'] = self.gtol
          if self.bfgs_factor is not None:
              opt_dict['factr'] = self.bfgs_factor
  
          opt_result = optimize.fmin_l_bfgs_b(f_fp, x_init, maxfun=self.max_iters, maxiter=self.max_iters, **opt_dict)
          self.x_opt = opt_result[0]
          self.f_opt = f_fp(self.x_opt)[0]
          self.funct_eval = opt_result[2]['funcalls']
          self.status = rcstrings[opt_result[2]['warnflag']]
  
          #a more helpful error message is available in opt_result in the Error case
          if opt_result[2]['warnflag']==2: # pragma: no coverage, this is not needed to be covered
              self.status = 'Error' + str(opt_result[2]['task'])
docs: Run the optimizer