U
    Gvf                     @   s,   d dl mZ d dlmZ dgZdddZdS )	   )_minimize_trust_region)get_trlib_quadratic_subproblem_minimize_trust_krylov NTc                 K   s   |dkrt dd|dkr*|dkr*t d|r^t| |f||||tdd|ddd	d
|S t| |f||||tdd|ddd	d
|S dS )a  
    Minimization of a scalar function of one or more variables using
    a nearly exact trust-region algorithm that only requires matrix
    vector products with the hessian matrix.

    .. versionadded:: 1.0.0

    Options
    -------
    inexact : bool, optional
        Accuracy to solve subproblems. If True requires less nonlinear
        iterations, but more vector products.
    Nz&Jacobian is required for trust region zexact minimization.zaEither the Hessian or the Hessian-vector product is required for Krylov trust-region minimizationg       g      dispF)Z	tol_rel_iZ	tol_rel_br   )argsjachesshesspZ
subproblemg:0yE>gư>)
ValueErrorr   r   get)ZfunZx0r   r   r	   r
   ZinexactZtrust_region_optionsr   r   F/tmp/pip-unpacked-wheel-96ln3f52/scipy/optimize/_trustregion_krylov.pyr      s:      
  
)r   NNNT)Z_trustregionr   Z_trlibr   __all__r   r   r   r   r   <module>   s
     