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","."]
code: def __init__(
      self, x, fun, jac, hess, hessp=None, k_easy=0.1, k_hard=0.2
  ):
      super().__init__(x, fun, jac, hess)
  
      # When the trust-region shrinks in two consecutive
      # calculations (``tr_radius < previous_tr_radius``)
      # the lower bound ``lambda_lb`` may be reused,
      # facilitating  the convergence. To indicate no
      # previous value is known at first ``previous_tr_radius``
      # is set to -1  and ``lambda_lb`` to None.
      self.previous_tr_radius = -1
      self.lambda_lb = None
  
      self.niter = 0
  
      # ``k_easy`` and ``k_hard`` are parameters used
      # to determine the stop criteria to the iterative
      # subproblem solver. Take a look at pp. 194-197
      # from reference _[1] for a more detailed description.
      self.k_easy = k_easy
      self.k_hard = k_hard
  
      # Get Lapack function for cholesky decomposition.
      # The implemented SciPy wrapper does not return
      # the incomplete factorization needed by the method.
      (self.cholesky,) = get_lapack_funcs(("potrf",), (self.hess,))
  
      # Get info about Hessian
      self.dimension = len(self.hess)
      (
          self.hess_gershgorin_lb,
          self.hess_gershgorin_ub,
      ) = gershgorin_bounds(self.hess)
      self.hess_inf = norm(self.hess, np.inf)
      self.hess_fro = norm(self.hess, "fro")
  
      # A constant such that for vectors smaller than that
      # backward substituition is not reliable. It was stabilished
      # based on Golub, G. H., Van Loan, C. F. (2013).
      # "Matrix computations". Forth Edition. JHU press., p.165.
      self.CLOSE_TO_ZERO = self.dimension * self.EPS * self.hess_inf
  
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 1 to create a new IterativeSubproblem object from inherited base classes: BaseQuadraticSubproblem with example: obj = IterativeSubproblem(x, fun, jac, hess, hessp, k_easy, k_hard)