
    tKg`                         d dl Zd dlmZ ddlmZmZ ddlm	Z	 d dl
mZ d dlmZmZ dZddZdd	Zdd
Z G d d      Z G d d      Z G d d      Z G d de      Zy)    N   )approx_derivativegroup_columns)HessianUpdateStrategy)LinearOperator)
atleast_ndarray_namespace)z2-pointz3-pointcsc                 $     dg fd}|fS )Nr   c                    dxx   dz  cc<    t        j                  |       g }t        j                  |      s&	 t        j                  |      j	                         }|S |S # t
        t        f$ r}t        d      |d }~ww xY w)Nr   r   z@The user-provided objective function must return a scalar value.)npcopyisscalarasarrayitem	TypeError
ValueError)xfxeargsfunncallss      l/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/scipy/optimize/_differentiable_functions.pywrappedz_wrapper_fun.<locals>.wrapped   s    q	Q	 #d#{{2ZZ^((* 	r	 z*  2 s   #A( (B7BB )r   r   r   r   s   `` @r   _wrapper_funr      s    SF  F?    c                 h     dgt               r fd}|fS  t        v rdfd	}|fS y )Nr   c                 |    dxx   dz  cc<   t        j                   t        j                  |       g       S Nr   r   )r   
atleast_1dr   )r   kwdsr   gradr   s     r   r   z_wrapper_grad.<locals>.wrapped&   s1    1INI==bggaj!84!899r   c                 <    dxx   dz  cc<   t        | fd|iS )Nr   r   f0r   )r   r&   finite_diff_optionsr   r   s     r   wrapped1z_wrapper_grad.<locals>.wrapped1-   s2    1INI$Q!4 r   N)callable
FD_METHODS)r$   r   r   r(   r   r)   r   s   ````  @r   _wrapper_gradr-   "   sA    SF~	: 			  
r   c                     t               r  t        j                  |      g }dgt        j                  |      r fd}t        j
                  |      }nGt        |t              r fd}n/ fd}t        j                  t        j                  |            }||fS  t        v rdgdfd	}|d fS y )Nr   c                 |    dxx   dz  cc<   t        j                   t        j                  |       g       S r!   )sps
csr_matrixr   r   r   r#   r   hessr   s     r   r   z_wrapper_hess.<locals>.wrapped<   s1    q	Q	~~d2771:&=&=>>r   c                 V    dxx   dz  cc<    t        j                  |       g S r!   )r   r   r2   s     r   r   z_wrapper_hess.<locals>.wrappedC   s(    q	Q	BGGAJ...r   c           	          dxx   dz  cc<   t        j                  t        j                   t        j                  |       g             S r!   )r   
atleast_2dr   r   r2   s     r   r   z_wrapper_hess.<locals>.wrappedH   s:    q	Q	}}RZZRWWQZ0G$0G%HIIr   r   c                 "    t        | fd|iS Nr&   r'   )r   r&   r(   r$   s     r   r)   z_wrapper_hess.<locals>.wrapped1R   s%    $a"5 r   r*   )r+   r   r   r0   issparser1   
isinstancer   r6   r   r,   )	r3   r$   x0r   r(   Hr   r)   r   s	   `` ``   @r   _wrapper_hessr=   6   s    ~$t$<<?? q!A>*/
J bjjm,A!!			
 %% 
r   c                   z    e Zd ZdZ	 ddZed        Zed        Zed        Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zy)ScalarFunctiona  Scalar function and its derivatives.

    This class defines a scalar function F: R^n->R and methods for
    computing or approximating its first and second derivatives.

    Parameters
    ----------
    fun : callable
        evaluates the scalar function. Must be of the form ``fun(x, *args)``,
        where ``x`` is the argument in the form of a 1-D array and ``args`` is
        a tuple of any additional fixed parameters needed to completely specify
        the function. Should return a scalar.
    x0 : array-like
        Provides an initial set of variables for evaluating fun. Array of real
        elements of size (n,), where 'n' is the number of independent
        variables.
    args : tuple, optional
        Any additional fixed parameters needed to completely specify the scalar
        function.
    grad : {callable, '2-point', '3-point', 'cs'}
        Method for computing the gradient vector.
        If it is a callable, it should be a function that returns the gradient
        vector:

            ``grad(x, *args) -> array_like, shape (n,)``

        where ``x`` is an array with shape (n,) and ``args`` is a tuple with
        the fixed parameters.
        Alternatively, the keywords  {'2-point', '3-point', 'cs'} can be used
        to select a finite difference scheme for numerical estimation of the
        gradient with a relative step size. These finite difference schemes
        obey any specified `bounds`.
    hess : {callable, '2-point', '3-point', 'cs', HessianUpdateStrategy}
        Method for computing the Hessian matrix. If it is callable, it should
        return the  Hessian matrix:

            ``hess(x, *args) -> {LinearOperator, spmatrix, array}, (n, n)``

        where x is a (n,) ndarray and `args` is a tuple with the fixed
        parameters. Alternatively, the keywords {'2-point', '3-point', 'cs'}
        select a finite difference scheme for numerical estimation. Or, objects
        implementing `HessianUpdateStrategy` interface can be used to
        approximate the Hessian.
        Whenever the gradient is estimated via finite-differences, the Hessian
        cannot be estimated with options {'2-point', '3-point', 'cs'} and needs
        to be estimated using one of the quasi-Newton strategies.
    finite_diff_rel_step : None or array_like
        Relative step size to use. The absolute step size is computed as
        ``h = finite_diff_rel_step * sign(x0) * max(1, abs(x0))``, possibly
        adjusted to fit into the bounds. For ``method='3-point'`` the sign
        of `h` is ignored. If None then finite_diff_rel_step is selected
        automatically,
    finite_diff_bounds : tuple of array_like
        Lower and upper bounds on independent variables. Defaults to no bounds,
        (-np.inf, np.inf). Each bound must match the size of `x0` or be a
        scalar, in the latter case the bound will be the same for all
        variables. Use it to limit the range of function evaluation.
    epsilon : None or array_like, optional
        Absolute step size to use, possibly adjusted to fit into the bounds.
        For ``method='3-point'`` the sign of `epsilon` is ignored. By default
        relative steps are used, only if ``epsilon is not None`` are absolute
        steps used.

    Notes
    -----
    This class implements a memoization logic. There are methods `fun`,
    `grad`, hess` and corresponding attributes `f`, `g` and `H`. The following
    things should be considered:

        1. Use only public methods `fun`, `grad` and `hess`.
        2. After one of the methods is called, the corresponding attribute
           will be set. However, a subsequent call with a different argument
           of *any* of the methods may overwrite the attribute.
    Nc	                    t        |      s|t        vrt        dt         d      t        |      s+|t        v s#t        |t              st        dt         d      |t        v r|t        v rt        d      t        |      x| _        }	t        |d|	      }
|	j                  }|	j                  |
j                  d      r|
j                  }t        ||      \  | _        | _        || _        || _        || _        || _        |	j%                  |
|      | _        || _        | j&                  j*                  | _        d	| _        d	| _        d	| _        d | _        t6        j8                  | _        i }|t        v r||d
<   ||d<   ||d<   ||d<   |t        v r||d
<   ||d<   ||d<   d|d<   | j=                          t?        || j                  ||      \  | _         | _!        | jE                          t        |      r)tG        |||      \  | _$        | _%        | _&        d| _        y |t        v rptG        || j@                  ||      \  | _$        | _%        | _&        | jE                          | jI                  | j&                  | jN                        | _&        d| _        y t        |t              rK|| _&        | jL                  jQ                  | j,                  d       d| _        d | _)        d | _*        dg| _%        y y )Nz)`grad` must be either callable or one of .z@`hess` must be either callable, HessianUpdateStrategy or one of zWhenever the gradient is estimated via finite-differences, we require the Hessian to be estimated using one of the quasi-Newton strategies.r   ndimxpreal floating)r   Fmethodrel_stepabs_stepboundsTas_linear_operator)r   r   r(   )r;   r   )r$   r;   r(   r&   r3   r   )+r+   r,   r   r:   r   r	   rD   r   float64isdtypedtyper   _wrapped_fun_nfev	_orig_fun
_orig_grad
_orig_hess_argsastyper   x_dtypesizen	f_updated	g_updated	H_updated	_lowest_xr   inf	_lowest_f_update_funr-   _wrapped_grad_ngev_update_gradr=   _wrapped_hess_nhevr<   g
initializex_prevg_prev)selfr   r;   r   r$   r3   finite_diff_rel_stepfinite_diff_boundsepsilonrD   _x_dtyper(   s                r   __init__zScalarFunction.__init__   s   ~$j"8;J<qI  $*"4d$9:(\, 
 :$*"4 8 9 9
 'r**"r*::bhh0XXF )5St(D%4:
 2v& :,0).B
+.5
+,>):,0).B
+.5
+8< 45 	 *7!! 3	*
&DJ 	 D>5B$62D
DF "DNZ5B''$7	62D
DF ''466':DF!DN34DFFFdfff-!DNDKDKDJ 5r   c                      | j                   d   S Nr   )rP   ri   s    r   nfevzScalarFunction.nfev      zz!}r   c                      | j                   d   S rq   )ra   rr   s    r   ngevzScalarFunction.ngev  rt   r   c                      | j                   d   S rq   )rd   rr   s    r   nhevzScalarFunction.nhev	  rt   r   c                    t        | j                  t              r| j                          | j                  | _        | j                  | _        t        |d| j                        }| j                  j                  || j                        | _        d| _        d| _        d| _        | j                          y t        |d| j                        }| j                  j                  || j                        | _        d| _        d| _        d| _        y Nr   rB   F)r:   rS   r   rb   r   rg   re   rh   r   rD   rU   rV   rY   rZ   r[   _update_hessri   r   rm   s      r   	_update_xzScalarFunction._update_x  s    doo'<=&&DK&&DK AA$''2BWW^^B5DF"DN"DN"DN AA$''2BWW^^B5DF"DN"DN"DNr   c                     | j                   sQ| j                  | j                        }|| j                  k  r| j                  | _        || _        || _        d| _         y y NT)rY   rO   r   r^   r\   f)ri   r   s     r   r_   zScalarFunction._update_fun$  sN    ~~""466*BDNN"!%!#DF!DN r   c                     | j                   sV| j                  t        v r| j                          | j	                  | j
                  | j                        | _        d| _         y y NrK   T)rZ   rR   r,   r_   r`   r   r   re   rr   s    r   rb   zScalarFunction._update_grad.  sL    ~~*,  "''466':DF!DN	 r   c                    | j                   s| j                  t        v r=| j                          | j	                  | j
                  | j                        | _        nt        | j                  t              r[| j                          | j                  j                  | j
                  | j                  z
  | j                  | j                  z
         n | j	                  | j
                        | _        d| _         y y r   )r[   rS   r,   rb   rc   r   re   r<   r:   r   updaterg   rh   rr   s    r   r{   zScalarFunction._update_hess5  s    ~~*,!!#++DFFtvv+>DOO-BC!!#dfft{{2DFFT[[4HI++DFF3!DN r   c                     t        j                  || j                        s| j                  |       | j	                          | j
                  S r*   )r   array_equalr   r}   r_   r   ri   r   s     r   r   zScalarFunction.funB  s5    ~~a(NN1vvr   c                     t        j                  || j                        s| j                  |       | j	                          | j
                  S r*   )r   r   r   r}   rb   re   r   s     r   r$   zScalarFunction.gradH  5    ~~a(NN1vvr   c                     t        j                  || j                        s| j                  |       | j	                          | j
                  S r*   )r   r   r   r}   r{   r<   r   s     r   r3   zScalarFunction.hessN  r   r   c                     t        j                  || j                        s| j                  |       | j	                          | j                          | j                  | j                  fS r*   )r   r   r   r}   r_   rb   r   re   r   s     r   fun_and_gradzScalarFunction.fun_and_gradT  sJ    ~~a(NN1vvtvv~r   r*   )__name__
__module____qualname____doc__ro   propertyrs   rv   rx   r}   r_   rb   r{   r   r$   r3   r   r   r   r   r?   r?   Z   sy    IV .2Zx      #."""r   r?   c                   F    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zy)VectorFunctiona  Vector function and its derivatives.

    This class defines a vector function F: R^n->R^m and methods for
    computing or approximating its first and second derivatives.

    Notes
    -----
    This class implements a memoization logic. There are methods `fun`,
    `jac`, hess` and corresponding attributes `f`, `J` and `H`. The following
    things should be considered:

        1. Use only public methods `fun`, `jac` and `hess`.
        2. After one of the methods is called, the corresponding attribute
           will be set. However, a subsequent call with a different argument
           of *any* of the methods may overwrite the attribute.
    c	                     t              st        vrt        dt         d      t              s+t        v s#t        t              st        dt         d      t        v rt        v rt        d      t        |      x _        }	t        |d|	      }
|	j                  }|	j                  |
j                  d      r|
j                  }|	j                  |
|       _        | _         j                  j                   _        d _        d _        d _        d	 _        d	 _        d	 _        i t        v rGd
<   |d<   |t-        |      }||fd<   |d<   t/        j0                   j                         _        t        v r3d
<   |d<   dd<   t/        j0                   j                         _        t        v rt        v rt        d       fd fd}| _         |        t/        j6                   j8                         _         j:                  j                   _        t              r  j                         _        d _         xj"                  dz  c_        |s!|QtA        jB                   j>                        r2 fdtA        jD                   j>                         _        d _#        n}tA        jB                   j>                        r- fd j>                  jI                          _        d	 _#        n1 fdt/        jJ                   j>                         _        d	 _#         fd}nt        v rtM         j                  fd j8                  i _        d _        |s!|RtA        jB                   j>                        r3 fd}tA        jD                   j>                         _        d _#        ntA        jB                   j>                        r. fd} j>                  jI                          _        d	 _#        n2 fd}t/        jJ                   j>                         _        d	 _#         _'        t              r  j                   j:                         _(        d _         xj$                  dz  c_        tA        jB                   jP                        r+ fdtA        jD                   jP                         _(        n^t         jP                  tR              r fdn= fdt/        jJ                  t/        jT                   jP                               _(         fd}nzt        v rfd fd} |        d _        nWt        t              rG _(         jP                  jW                   j                  d        d _        d  _,        d  _-         fd!} _.        t        t              r fd"}| _/        y  fd#}| _/        y )$Nz(`jac` must be either callable or one of rA   z?`hess` must be either callable,HessianUpdateStrategy or one of zWhenever the Jacobian is estimated via finite-differences, we require the Hessian to be estimated using one of the quasi-Newton strategies.r   rB   rE   r   FrF   rG   sparsityrI   TrJ   c                 d    xj                   dz  c_         t        j                   |             S Nr   )rs   r   r"   )r   r   ri   s    r   fun_wrappedz,VectorFunction.__init__.<locals>.fun_wrapped  s#    IINI==Q((r   c                  4      j                         _        y r*   )r   r   )r   ri   s   r   
update_funz+VectorFunction.__init__.<locals>.update_fun  s     (DFr   c                 d    xj                   dz  c_         t        j                   |             S r   )njevr0   r1   r   jacri   s    r   jac_wrappedz,VectorFunction.__init__.<locals>.jac_wrapped  s#    IINI>>#a&11r   c                 Z    xj                   dz  c_          |       j                         S r   )r   toarrayr   s    r   r   z,VectorFunction.__init__.<locals>.jac_wrapped  s!    IINIq6>>++r   c                 d    xj                   dz  c_         t        j                   |             S r   )r   r   r6   r   s    r   r   z,VectorFunction.__init__.<locals>.jac_wrapped  s#    IINI==Q00r   c                  4      j                         _        y r*   )r   J)r   ri   s   r   
update_jacz+VectorFunction.__init__.<locals>.update_jac  s    $TVV,r   r&   c                      j                          t        j                  t        j                  fdj
                  i       _        y r8   )r_   r0   r1   r   r   r   r   r(   r   ri   s   r   r   z+VectorFunction.__init__.<locals>.update_jac  sF    $$& ^^)+tvv A$&& A,?ABDFr   c                      j                          t        j                  fdj                  i j	                         _        y r8   )r_   r   r   r   r   r   r   s   r   r   z+VectorFunction.__init__.<locals>.update_jac  sC    $$&.{DFF Ftvv F1DFFMgi Fr   c                      j                          t        j                  t        j                  fdj
                  i       _        y r8   )r_   r   r6   r   r   r   r   r   s   r   r   z+VectorFunction.__init__.<locals>.update_jac  sF    $$&]])+tvv A$&& A,?ABDFr   c                 f    xj                   dz  c_         t        j                   | |            S r   )rx   r0   r1   r   vr3   ri   s     r   hess_wrappedz-VectorFunction.__init__.<locals>.hess_wrapped  s%    IINI>>$q!*55r   c                 @    xj                   dz  c_          | |      S r   )rx   r   s     r   r   z-VectorFunction.__init__.<locals>.hess_wrapped  s    IINI1:%r   c                     xj                   dz  c_         t        j                  t        j                   | |                  S r   )rx   r   r6   r   r   s     r   r   z-VectorFunction.__init__.<locals>.hess_wrapped  s.    IINI==DAJ)?@@r   c                  J      j                   j                        _        y r*   )r   r   r<   )r   ri   s   r   update_hessz,VectorFunction.__init__.<locals>.update_hess  s    %dffdff5r   c                 F     |       j                   j                  |      S r*   )Tdot)r   r   r   s     r   	jac_dot_vz*VectorFunction.__init__.<locals>.jac_dot_v  s    "1~''++A..r   c                      j                          t        j                  fj                  j                  j                  j                        j                  fd _        y )N)r&   r   )_update_jacr   r   r   r   r   r   r<   )r(   r   ri   s   r   r   z,VectorFunction.__init__.<locals>.update_hess  sW      "*9dff B.2ffhhll466.B15	B .ABr   r3   c                     j                          j                  j                  j                  j                  z
  } j                  j
                  j                  j                        j                  j
                  j                  j                        z
  }j                  j                  | |       y y y r*   )
r   rg   J_prevr   r   r   r   r   r<   r   )delta_xdelta_gri   s     r   r   z,VectorFunction.__init__.<locals>.update_hess   s      " ;;*t{{/F"fft{{2G"ffhhll4662T[[]]5F5Ftvv5NNGFFMM'73 0G*r   c                 :   j                          j                  _        j                  _        t        | dj                        }j                  j                  |j                        _        d_	        d_
        d_        j                          y rz   )r   r   rg   r   r   r   rD   rU   rV   rY   	J_updatedr[   r{   r   rm   ri   s     r   update_xz)VectorFunction.__init__.<locals>.update_x,  sr      ""ff"ffdgg6DLL9!&!&!&!!#r   c                     t        | dj                        }j                  j                  |j                        _        d_        d_        d_        y rz   )r   rD   rU   rV   r   rY   r   r[   r   s     r   r   z)VectorFunction.__init__.<locals>.update_x7  sD    dgg6DLL9!&!&!&r   )0r+   r,   r   r:   r   r	   rD   r   rL   rM   rN   rU   r   rV   rW   rX   rs   r   rx   rY   r   r[   r   r   r   x_diff_update_fun_impl
zeros_liker   r   mr   r0   r9   r1   sparse_jacobianr   r6   r   _update_jac_implr<   r   r   rf   rg   r   _update_hess_impl_update_x_impl)ri   r   r;   r   r3   rj   finite_diff_jac_sparsityrk   r   rD   rm   rn   sparsity_groupsr   r   r   r   r(   r   r   r   r   s   `` ``            @@@@@r   ro   zVectorFunction.__init__m  s    }J!6G
|STUVV$*"4d$9: @@J|1N O O *!3 + , ,
 'r**"r*::bhh0XXF 2v&			 *,/).B
+'3"/0H"I3K3B3D#J/,>)''$&&/DK:,0).B
+8< 45''$&&/DK*!3 + , ,	)	) !+tvv& C=[DF!DNIINI#+TVV0D2 /'+$dff%, )',$1 tvv.',$- J&{DFF >tvv >)<>DF!DN#+TVV0DB
 /'+$dff%P )',$B
 tvv.',$ * D>$&&$&&)DF!DNIINI||DFF#6 /DFFN3&
A rzz$&&'9:6Z/B M!DN34DFFFdfff-!DNDKDK4 "-d12	$$ '' 'r   c                 b    t        j                  || j                        s|| _        d| _        y y )NF)r   r   r   r[   )ri   r   s     r   	_update_vzVectorFunction._update_v@  s'    ~~a(DF"DN )r   c                 h    t        j                  || j                        s| j                  |       y y r*   )r   r   r   r   r   s     r   r}   zVectorFunction._update_xE  s'    ~~a(" )r   c                 L    | j                   s| j                          d| _         y y r   )rY   r   rr   s    r   r_   zVectorFunction._update_funI  !    ~~!!#!DN r   c                 L    | j                   s| j                          d| _         y y r   )r   r   rr   s    r   r   zVectorFunction._update_jacN  r   r   c                 L    | j                   s| j                          d| _         y y r   )r[   r   rr   s    r   r{   zVectorFunction._update_hessS  s!    ~~""$!DN r   c                 \    | j                  |       | j                          | j                  S r*   )r}   r_   r   r   s     r   r   zVectorFunction.funX  #    qvvr   c                 \    | j                  |       | j                          | j                  S r*   )r}   r   r   r   s     r   r   zVectorFunction.jac]  r   r   c                 ~    | j                  |       | j                  |       | j                          | j                  S r*   )r   r}   r{   r<   ri   r   r   s      r   r3   zVectorFunction.hessb  s/    qqvvr   N)r   r   r   r   ro   r   r}   r_   r   r{   r   r   r3   r   r   r   r   r   \  s6     Q'f#
#"
"
"


r   r   c                   .    e Zd ZdZd Zd Zd Zd Zd Zy)LinearVectorFunctionzLinear vector function and its derivatives.

    Defines a linear function F = A x, where x is N-D vector and
    A is m-by-n matrix. The Jacobian is constant and equals to A. The Hessian
    is identically zero and it is returned as a csr matrix.
    c                    |s|7t        j                  |      r"t        j                  |      | _        d| _        nft        j                  |      r|j                         | _        d| _        n4t        j                  t        j                  |            | _        d| _        | j                  j                  \  | _
        | _        t        |      x| _        }t        |d|      }|j                  }|j!                  |j"                  d      r|j"                  }|j%                  ||      | _        || _        | j                  j+                  | j&                        | _        d| _        t        j0                  | j                  t2              | _        t        j                  | j                  | j                  f      | _        y )NTFr   rB   rE   )rN   )r0   r9   r1   r   r   r   r   r6   r   shaper   rX   r	   rD   r   rL   rM   rN   rU   r   rV   r   r   rY   zerosfloatr   r<   )ri   Ar;   r   rD   rm   rn   s          r   ro   zLinearVectorFunction.__init__q  s3   o5#,,q/^^A&DF#'D \\!_YY[DF#(D  ]]2::a=1DF#(D &r**"r*::bhh0XXF 2v&DFF#$&&. 01r   c                     t        j                  || j                        sKt        |d| j                        }| j                  j                  || j                        | _        d| _        y y rz   )r   r   r   r   rD   rU   rV   rY   r|   s      r   r}   zLinearVectorFunction._update_x  sL    ~~a(AA$''2BWW^^B5DF"DN )r   c                     | j                  |       | j                  s'| j                  j                  |      | _        d| _        | j                  S r   )r}   rY   r   r   r   r   s     r   r   zLinearVectorFunction.fun  s8    q~~VVZZ]DF!DNvvr   c                 <    | j                  |       | j                  S r*   )r}   r   r   s     r   r   zLinearVectorFunction.jac  s    qvvr   c                 J    | j                  |       || _        | j                  S r*   )r}   r   r<   r   s      r   r3   zLinearVectorFunction.hess  s    qvvr   N)	r   r   r   r   ro   r}   r   r   r3   r   r   r   r   r   j  s     2<#r   r   c                   "     e Zd ZdZ fdZ xZS )IdentityVectorFunctionzIdentity vector function and its derivatives.

    The Jacobian is the identity matrix, returned as a dense array when
    `sparse_jacobian=False` and as a csr matrix otherwise. The Hessian is
    identically zero and it is returned as a csr matrix.
    c                     t        |      }|s|t        j                  |d      }d}nt        j                  |      }d}t        |   |||       y )Ncsr)formatTF)lenr0   eyer   superro   )ri   r;   r   rX   r   	__class__s        r   ro   zIdentityVectorFunction.__init__  sL    Go5%(A"Oq	A#OB0r   )r   r   r   r   ro   __classcell__)r   s   @r   r   r     s    1 1r   r   )r   )Nr   N)NNr   N)numpyr   scipy.sparsesparser0   _numdiffr   r   _hessian_update_strategyr   scipy.sparse.linalgr   scipy._lib._array_apir   r	   r,   r   r-   r=   r?   r   r   r   r   r   r   <module>r      s`      6 ; . = *
, (!&H DK K\9 9x11 1r   