class_docstr: Quadratic subproblem solved by nearly exact iterative method.
  
  Notes
  -----
  This subproblem solver was based on [1]_, [2]_ and [3]_,
  which implement similar algorithms. The algorithm is basically
  that of [1]_ but ideas from [2]_ and [3]_ were also used.
  
  References
  ----------
  .. [1] A.R. Conn, N.I. Gould, and P.L. Toint, "Trust region methods",
         Siam, pp. 169-200, 2000.
  .. [2] J. Nocedal and  S. Wright, "Numerical optimization",
         Springer Science & Business Media. pp. 83-91, 2006.
  .. [3] J.J. More and D.C. Sorensen, "Computing a trust region step",
         SIAM Journal on Scientific and Statistical Computing, vol. 4(3),
         pp. 553-572, 1983.
class_docstr_tok: ["Quadratic","subproblem","solved","by","nearly","exact","iterative","method",".","Notes","--","--","-","This","subproblem","solver","was","based","on","[","1","]","_",",","[","2","]","_","and","[","3","]","_",",","which","implement","similar","algorithms",".","The","algorithm","is","basically","that","of","[","1","]","_","but","ideas","from","[","2","]","_","and","[","3","]","_","were","also","used",".","References","--","--","--","--","--","..","[","1","]","A.R",".","Conn",",","N.I",".","Gould",",","and","P.L",".","Toint",",","``","Trust","region","methods","''",",","Siam",",","pp",".","169-200",",","2000",".","..","[","2","]","J.","Nocedal","and","S.","Wright",",","``","Numerical","optimization","''",",","Springer","Science","&","Business","Media",".","pp",".","83-91",",","2006",".","..","[","3","]","J.J.","More","and","D.C.","Sorensen",",","``","Computing","a","trust","region","step","''",",","SIAM","Journal","on","Scientific","and","Statistical","Computing",",","vol",".","4","(","3",")",",","pp",".","553-572",",","1983","."]
docstr: Given a trust radius, return a good initial guess for
  the damping factor, the lower bound and the upper bound.
  The values were chosen accordingly to the guidelines on
  section 7.3.8 (p. 192) from [1]_.
docstr_tok: ["Given","a","trust","radius",",","return","a","good","initial","guess","for","the","damping","factor",",","the","lower","bound","and","the","upper","bound",".","The","values","were","chosen","accordingly","to","the","guidelines","on","section","7.3.8","(","p.","192",")","from","[","1","]","_","."]
code: def _initial_values(self, tr_radius):
      """Given a trust radius, return a good initial guess for
      the damping factor, the lower bound and the upper bound.
      The values were chosen accordingly to the guidelines on
      section 7.3.8 (p. 192) from [1]_.
      """
  
      # Upper bound for the damping factor
      lambda_ub = max(
          0,
          self.jac_mag / tr_radius
          + min(-self.hess_gershgorin_lb, self.hess_fro, self.hess_inf),
      )
  
      # Lower bound for the damping factor
      lambda_lb = max(
          0,
          -min(self.hess.diagonal()),
          self.jac_mag / tr_radius
          - min(self.hess_gershgorin_ub, self.hess_fro, self.hess_inf),
      )
  
      # Improve bounds with previous info
      if tr_radius < self.previous_tr_radius:
          lambda_lb = max(self.lambda_lb, lambda_lb)
  
      # Initial guess for the damping factor
      if lambda_lb == 0:
          lambda_initial = 0
      else:
          lambda_initial = max(
              np.sqrt(lambda_lb * lambda_ub),
              lambda_lb + self.UPDATE_COEFF * (lambda_ub - lambda_lb),
          )
  
      return lambda_initial, lambda_lb, lambda_ub
  
file_path: scipy/scipy/optimize/_trustregion_exact.py
imports: import numpy
  from scipy.linalg import norm, get_lapack_funcs, solve_triangular, cho_solve
  from ._trustregion import _minimize_trust_region, BaseQuadraticSubproblem
label_desc: Use image node_id 2 for calling the IterativeSubproblem obj's underlying member method code with example usage: obj._initial_values(tr_radius) and returns: lambda_initial,  lambda_lb,  lambda_ub