+
    LV-jîË  ã                   óF  € ^ RI t ^ RIt^ RIt^ RIt^ RIHtHtHt ^ RIH	t	H
t
HtHtHtHt ^ RIt^ RIt^ RIHt ^ RIHtHt ^ RIHt ^RIHtHt ^ RI Ht ^ R	IHt ^ R
IHt . R:Ot  ! R R]!4      t"R t#R t$R t%R t&]'! ]! R4      PQ                  4       ]! R4      PQ                  4       R7      t)R t*R;R lt+]*! ]+4       R<R  lt, ! R! R"4      t- ! R# R$4      t. ! R% R4      t/R& t0 ! R' R(].4      t1 ! R) R*4      t2]! R+4      PQ                  4       ])R,&    ! R- R]14      t3 ! R. R/]34      t4 ! R0 R1]14      t5 ! R2 R3]14      t6 ! R4 R5]14      t7 ! R6 R7]14      t8 ! R8 R].4      t9R9 t:]:! R]34      t;]:! R]44      t<]:! R]54      t=]:! R]74      t>]:! R]64      t?]:! R]84      t@]:! R]94      tAR# )=é    N)ÚasarrayÚdotÚvdot)ÚnormÚsolveÚinvÚqrÚsvdÚLinAlgError)Úget_blas_funcs)Úcopy_if_neededÚ_dedent_for_py313)Úgetfullargspec_no_self)Úscalar_search_wolfe1Úscalar_search_armijo)Ú	signature)Úget_close_matches)ÚGenericAliasÚbroyden1Úbroyden2ÚandersonÚlinearmixingÚdiagbroydenÚexcitingmixingÚnewton_krylovÚBroydenFirstÚKrylovJacobianÚInverseJacobianÚNoConvergencec                   ó   € ] tR t^!tRtRtR# )r   zXException raised when nonlinear solver fails to converge within the specified
`maxiter`.© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r!   ó    Úg/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/optimize/_nonlin.pyr   r   !   s
   † ñãr(   c                 óJ   € \         P                  ! V 4      P                  4       # ©N)ÚnpÚabsoluteÚmax©Úxs   &r)   Úmaxnormr1   '   s   € Ü�;Š;�q‹>×ÑÓÐr(   c                ó¼   € \        V 4      p \        P                  ! V P                  \        P                  4      '       g   \        V \        P
                  R7      # V # )z:Return `x` as an array, of either floats or complex floats©Údtype)r   r,   Ú
issubdtyper4   ÚinexactÚfloat64r/   s   &r)   Ú_as_inexactr8   +   s:   € ä�‹
€AÜ�=Š=˜Ÿ™¤"§*¡*×-Ò-Ü�q¤§
¡
Ô+Ð+Ø€Hr(   c                ó–   € \         P                  ! V \         P                  ! V4      4      p \        VRV P                  4      pV! V 4      # )z;Return ndarray `x` as same array subclass and shape as `x0`Ú__array_wrap__)r,   ÚreshapeÚshapeÚgetattrr:   )r0   Úx0Úwraps   && r)   Ú_array_liker@   3   s8   € ä
�
Š
�1”b—h’h˜r“lÓ#€AÜ�2Ð'¨×)9Ñ)9Ó:€DÙ�‹7€Nr(   c                 ó´   € \         P                  ! V 4      P                  4       '       g%   \         P                  ! \         P                  4      # \        V 4      # r+   )r,   ÚisfiniteÚallÚarrayÚinfr   )Úvs   &r)   Ú
_safe_normrG   :   s5   € Ü�;Š;�q‹>×Ñ×ÒÜ�xŠxœŸ™ÓÐÜ�‹7€Nr(   z´
    F : function(x) -> f
        Function whose root to find; should take and return an array-like
        object.
    xin : array_like
        Initial guess for the solution
    a€  
    iter : int, optional
        Number of iterations to make. If omitted (default), make as many
        as required to meet tolerances.
    verbose : bool, optional
        Print status to stdout on every iteration.
    maxiter : int, optional
        Maximum number of iterations to make. If more are needed to
        meet convergence, `NoConvergence` is raised.
    f_tol : float, optional
        Absolute tolerance (in max-norm) for the residual.
        If omitted, default is 6e-6.
    f_rtol : float, optional
        Relative tolerance for the residual. If omitted, not used.
    x_tol : float, optional
        Absolute minimum step size, as determined from the Jacobian
        approximation. If the step size is smaller than this, optimization
        is terminated as successful. If omitted, not used.
    x_rtol : float, optional
        Relative minimum step size. If omitted, not used.
    tol_norm : function(vector) -> scalar, optional
        Norm to use in convergence check. Default is the maximum norm.
    line_search : {None, 'armijo' (default), 'wolfe'}, optional
        Which type of a line search to use to determine the step size in the
        direction given by the Jacobian approximation. Defaults to 'armijo'.
    callback : function, optional
        Optional callback function. It is called on every iteration as
        ``callback(x, f)`` where `x` is the current solution and `f`
        the corresponding residual.

    Returns
    -------
    sol : ndarray
        An array (of similar array type as `x0`) containing the final solution.

    Raises
    ------
    NoConvergence
        When a solution was not found.

    )Úparams_basicÚparams_extrac                 óf   € V P                   '       d   V P                   \        ,          V n         R # R # r+   )r&   Ú
_doc_parts)Úobjs   &r)   Ú_set_docrM   x   s    € Ø
‡{‡{€{Ø—k‘k¤JÕ.ˆŽñ r(   c                óü  a a€ V
f   \         MT
p
\        WgW‰W:R7      p\        S4      oV V3R lpSP                  4       p\        P
                  ! V\        P                  4      pV! V4      p\        V4      p\        V4      pVP                  VP                  4       VV4       Vf)   Ve   V^,           pM^dVP                  ^,           ,          pVRJ d   RpMVRJ d   RpVR9  d   \        R4      hRpR	pR
pRp\        V4       EF�  pVP                  VVV4      pV'       d    EM‘\        VVV,          4      pVP!                  VVR7      ) p\        V4      ^ 8X  d   \        R4      hV'       d   \#        VVVVV4      w  ppppMRpVV,           pV! V4      p\        V4      pVP%                  VP                  4       V4       V'       d
   V! VV4       VV^,          ,          V^,          ,          pVV^,          ,          V8  d   \        VV4      pM$\        V\'        VVV^,          ,          4      4      pTpV'       g   EKA  \(        P*                  P-                  V RV
! V4      R RVR R24       \(        P*                  P/                  4        EK’  	  V'       d   \1        \3        VS4      4      h^pV'       d3   RVP4                  RVRVRV^8H  R^R^R/V,          /p\3        VS4      V3# \3        VS4      # )a>  
Find a root of a function, in a way suitable for large-scale problems.

Parameters
----------
%(params_basic)s
jacobian : Jacobian
    A Jacobian approximation: `Jacobian` object or something that
    `asjacobian` can transform to one. Alternatively, a string specifying
    which of the builtin Jacobian approximations to use:

        krylov, broyden1, broyden2, anderson
        diagbroyden, linearmixing, excitingmixing

%(params_extra)s
full_output : bool
    If true, returns a dictionary `info` containing convergence
    information.
raise_exception : bool
    If True, a `NoConvergence` exception is raise if no solution is found.

See Also
--------
asjacobian, Jacobian

Notes
-----
This algorithm implements the inexact Newton method, with
backtracking or full line searches. Several Jacobian
approximations are available, including Krylov and Quasi-Newton
methods.

References
----------
.. [KIM] C. T. Kelley, "Iterative Methods for Linear and Nonlinear
   Equations". Society for Industrial and Applied Mathematics. (1995)
   https://archive.siam.org/books/kelley/fr16/

N)Úf_tolÚf_rtolÚx_tolÚx_rtolÚiterr   c                 óV   <€ \        S! \        V S4      4      4      P                  4       # r+   )r8   r@   Úflatten)ÚzÚFr>   s   &€€r)   ÚfuncÚnonlin_solve.<locals>.func°   s#   ø€ Ü™1œ[¨¨BÓ/Ó0Ó1×9Ñ9Ó;Ð;r(   TÚarmijoFzInvalid line searchgÍÌÌÌÌÌì?g§èH.ÿï?gš™™™™™¹?gü©ñÒMbP?)Útolz[Jacobian inversion yielded zero vector. This indicates a bug in the Jacobian approximation.ç      ð?z:  |F(x)| = Úgz; step Ú
ÚnitÚfunÚstatusÚsuccessÚmessagez0A solution was found at the specified tolerance.z:The maximum number of iterations allowed has been reached.)NrZ   Úwolfe)r1   ÚTerminationConditionr8   rU   r,   Ú	full_likerE   r   Ú
asjacobianÚsetupÚcopyÚsizeÚ
ValueErrorÚrangeÚcheckÚminr   Ú_nonlin_line_searchÚupdater.   ÚsysÚstdoutÚwriteÚflushr   r@   Ú	iteration) rW   r>   ÚjacobianrS   ÚverboseÚmaxiterrO   rP   rQ   rR   Útol_normÚline_searchÚcallbackÚfull_outputÚraise_exceptionÚ	conditionrX   r0   ÚdxÚFxÚFx_normÚgammaÚeta_maxÚeta_tresholdÚetaÚnra   r[   ÚsÚFx_norm_newÚeta_AÚinfos    ff&&&&&&&&&&&&&                 r)   Únonlin_solver‹   }   sá  ù€ ðZ #Ò*�w°€HÜ$¨5Ø+0Ø*.ô?€Iô 
�R‹€Bö<à
�
‰
‹€Aä	�Š�aœŸ™Ó	 €BÙ	ˆa‹€BÜ�2‹h€Gä˜(Ó#€HØ‡N�N�1—6‘6“8˜R Ô&à‚ØÒØ˜Q•h‰Gà˜1Ÿ6™6 !�8•nˆGà�dÓØ‰Ø	˜Ó	ØˆàÐ3Ô3ÜÐ.Ó/Ð/ð €EØ€GØ€LØ
€Cä�7�^ˆØ—‘  Q¨Ó+ˆßÚô �#�s˜7•{Ó#ˆØ�n‰n˜R SˆnÓ)Ð)ˆä�‹8�qŒ=Üð .ó /ð /÷
 Ü$7¸¸aÀÀRØ8Có%EÑ!ˆAˆq�"‘kð ˆAØ�B•ˆAÙ�a“ˆBÜ˜r›(ˆKà�‰˜Ÿ™› "Ô%çÙ�Q˜ŒOð ˜ Q�Õ&¨°!­Õ3ˆØ�3˜•6�>˜LÔ(Ü�g˜uÓ%‰Cä�gœs 5¨%°°Qµ­,Ó7Ó8ˆCàˆ÷ Š7Ü�J‰J×Ñ ˜s ,©x¸«|¸AÐ.>¸gÀaÈÀUÈ"ÐMÔNÜ�J‰J×Ñ×ñS ÷V Ü¤¨A¨rÓ 2Ó3Ð3àˆFçØ�y×*Ñ*Ø�rØ˜&Ø˜6 Q™;Ø˜Að  ,àð  3ðð %õ	&ð		ˆô ˜1˜bÓ! 4Ð'Ð'ä˜1˜bÓ!Ð!r(   c                 óÄ  a aaaaaaaa€ ^ .oV.o\        V4      ^,          .o\        S4      \        S4      ,          oR	VV VVVV3R lloVVV3R lpVR8X  d   \        SVS^ ,          RVR7      w  r‰p
M'VR8X  d!   \        SS^ ,          S^ ,          ) VR7      w  r‰Xf   RpSVS,          ,           oVS^ ,          8X  d   S^ ,          pMS ! S4      p\        V4      pVSW+3# )
r   c                 ó¸   <€ V S	^ ,          8X  d
   S^ ,          # S
V S,          ,           pS! V4      p\        V4      ^,          pV'       d   V S	^ &   VS^ &   VS^ &   V# ©r   )rG   )r‡   ÚstoreÚxtrF   Úpr   rX   Útmp_FxÚtmp_phiÚtmp_sr0   s   &&   €€€€€€r)   ÚphiÚ _nonlin_line_search.<locals>.phi  s_   ø€ Ø��a•Œ=Ø˜1•:ÐØ��2•�XˆÙ�‹HˆÜ�q‹M˜1ÕˆßØˆE�!‰HØˆG�A‰JØˆF�1‰IØˆr(   c                 óŒ   <€ \        V 4      S,           ^,           S,          pS! W,           RR7      S! V 4      ,
          V,          # )é   F)r�   )Úabs)r‡   Údsr•   ÚrdiffÚs_norms   & €€€r)   ÚderphiÚ#_nonlin_line_search.<locals>.derphi%  s7   ø€ Ü�!‹f�v�o Õ! UÕ*ˆÙ�A•D Ô&©¨Q«Õ/°2Õ5Ð5r(   rd   ç{®Gáz„?)ÚxtolÚaminrZ   )r¡   r\   )T)r   r   r   )rX   r0   r€   r   Úsearch_typer›   Úsminr�   r‡   Úphi1Úphi0r�   r•   rœ   r’   r“   r”   s   ff&f&f&     @@@@@r)   ro   ro     sß   ÿø€ àˆC€EØˆT€FÜ�B‹x˜�{ˆm€GÜ�!‹W”t˜B“xÕ€F÷
ô 
÷6ð �gÔÜ,¨S°&¸'À!½*Ø26¸TôC‰ˆ‘à	˜Ô	 Ü& s¨G°A­J¸À½¸Ø,0ô2‰ˆð 	‚yð ˆà	ˆAˆb�D�€AØˆE�!�H„}Ø�A�Y‰á�!‹WˆÜ�2‹h€Gàˆa�ÐÐr(   c                   ó@   a € ] tR tRt o RtRRRRR]3R ltR tRtV t	R# )re   i?  z•
Termination condition for an iteration. It is terminated if

- |F| < f_rtol*|F_0|, AND
- |F| < f_tol

AND

- |dx| < x_rtol*|x|, AND
- |dx| < x_tol

Nc                óT  € Vf6   \         P                  ! \         P                  4      P                  R,          pVf   \         P                  pVf   \         P                  pVf   \         P                  pW0n        W@n        Wn        W n        W`n	        WPn
        R V n        ^ V n        R # )NgUUUUUUÕ?)r,   Úfinfor7   ÚepsrE   rQ   rR   rO   rP   r   rS   Úf0_normru   )ÚselfrO   rP   rQ   rR   rS   r   s   &&&&&&&r)   Ú__init__ÚTerminationCondition.__init__L  s|   € ð Š=Ü—H’HœRŸZ™ZÓ(×,Ñ,°Õ6ˆEØŠ>Ü—V‘VˆFØŠ=Ü—F‘FˆEØŠ>Ü—V‘VˆFàŒ
ØŒØŒ
ØŒàŒ	àŒ	àˆŒØˆŽr(   c                ó  € V ;P                   ^,          un         V P                  V4      pV P                  V4      pV P                  V4      pV P                  f   W@n        V^ 8X  d   ^# V P                  e!   ^V P                   V P                  8„  ,          # \	        W@P
                  8*  ;'       dS    W@P                  ,          V P                  8*  ;'       d,    W`P                  8*  ;'       d    W`P                  ,          V8*  4      # )r˜   )	ru   r   rª   rS   ÚintrO   rP   rQ   rR   )r«   Úfr0   r   Úf_normÚx_normÚdx_norms   &&&&   r)   rm   ÚTerminationCondition.checkd  sÔ   € Ø�Š˜!Õ�Ø—‘˜1“ˆØ—‘˜1“ˆØ—)‘)˜B“-ˆà�<‰<ÒØ!ŒLà�QŒ;Ùà�9‰9Ò à˜Ÿ™¨¯©Ñ2Õ3Ð3ô �FŸj™jÑ(÷ ;ð ;ØŸ{™{Õ*¨d¯l©lÑ:÷;ð ;à§:¡:Ñ-÷ :ð :Ø#§K¡KÕ/°6Ñ9ó<ð 	<r(   )rª   rP   rO   rS   ru   r   rR   rQ   )
r"   r#   r$   r%   r&   r1   r¬   rm   r'   Ú__classdictcell__©Ú__classdict__s   @r)   re   re   ?  s)   ø‡ € ñð "¨$°dÀ4Ø ô÷0<ð <r(   re   c                   óV   a € ] tR tRt o Rt]! ]4      tR tR t	R
R lt
R tR tRtV tR	# )ÚJacobiani  a.  
Common interface for Jacobians or Jacobian approximations.

The optional methods come useful when implementing trust region
etc., algorithms that often require evaluating transposes of the
Jacobian.

Methods
-------
solve
    Returns J^-1 * v
update
    Updates Jacobian to point `x` (where the function has residual `Fx`)

matvec : optional
    Returns J * v
rmatvec : optional
    Returns A^H * v
rsolve : optional
    Returns A^-H * v
matmat : optional
    Returns A * V, where V is a dense matrix with dimensions (N,K).
todense : optional
    Form the dense Jacobian matrix. Necessary for dense trust region
    algorithms, and useful for testing.

Attributes
----------
shape
    Matrix dimensions (M, N)
dtype
    Data type of the matrix.
func : callable, optional
    Function the Jacobian corresponds to

c                óÊ   € . ROpVP                  4        F1  w  r4W29  d   \        RV 24      hVf   K  \        WW,          4       K3  	  \        V R4      '       d   RR lpR# R# )r   ÚtodensezUnknown keyword argument Nc                 óF   € Ve   \        RV 24      hV P                  4       # )Nz`dtype` must be None, was )rk   r»   )r«   r4   ri   s   &&&r)   Ú	__array__Ú$Jacobian.__init__.<locals>.__array__³  s'   € ØÒ$Ü$Ð'AÀ%ÀÐ%IÓJÐJØ—|‘|“~Ð%r(   )	r   rp   ÚmatvecÚrmatvecÚrsolveÚmatmatr»   r<   r4   ©NN)Úitemsrk   ÚsetattrÚhasattr)r«   ÚkwÚnamesÚnameÚvaluer½   s   &,    r)   r¬   ÚJacobian.__init__¨  s_   € ò8ˆàŸ8™8ž:‰KˆDØÔ Ü Ð#<¸T¸FÐ!CÓDÐDØÔ Ü˜ B¥HÖ-ñ	 &ô �4˜×#Ò#ö&ñ $r(   c                ó   € \        V 4      # r+   )r   ©r«   s   &r)   ÚaspreconditionerÚJacobian.aspreconditioner¸  s   € Ü˜tÓ$Ð$r(   c                ó   € \         hr+   ©ÚNotImplementedError©r«   rF   r[   s   &&&r)   r   ÚJacobian.solve»  ó   € Ü!Ð!r(   c                ó   € R # r+   r!   ©r«   r0   rW   s   &&&r)   rp   ÚJacobian.update¾  ó   € Ùr(   c                óä   € W0n         VP                  VP                  3V n        VP                  V n        V P                  P
                  \        P
                  J d   V P                  W4       R # R # r+   )rX   rj   r<   r4   Ú	__class__rh   r¹   rp   ©r«   r0   rW   rX   s   &&&&r)   rh   ÚJacobian.setupÁ  sM   € ØŒ	Ø—f‘f˜aŸf™fÐ%ˆŒ
Ø—W‘WˆŒ
Ø�>‰>×Ñ¤8§>¡>Ó1à�K‰K˜Öñ 2r(   )r4   rX   r<   NrŽ   )r"   r#   r$   r%   r&   Úclassmethodr   Ú__class_getitem__r¬   rÎ   r   rp   rh   r'   rµ   r¶   s   @r)   r¹   r¹     s6   ø‡ € ñ#ñL $ LÓ1Ðò&ò %ô"ò÷ð r(   r¹   c                   óZ   a € ] tR tRt o Rt]! ]4      tR t]	R 4       t
]	R 4       tRtV tR# )r   iÊ  aG  
A simple wrapper that inverts the Jacobian using the `solve` method.

.. legacy:: class

    See the newer, more consistent interfaces in :mod:`scipy.optimize`.

Parameters
----------
jacobian : Jacobian
    The Jacobian to invert.

Attributes
----------
shape
    Matrix dimensions (M, N)
dtype
    Data type of the matrix.

c                óæ   € Wn         VP                  V n        VP                  V n        \	        VR 4      '       d   VP
                  V n        \	        VR4      '       d   VP                  V n        R# R# )rh   rÁ   N)rv   r   r¿   rp   rÆ   rh   rÁ   rÀ   )r«   rv   s   &&r)   r¬   ÚInverseJacobian.__init__ã  sR   € Ø ŒØ—n‘nˆŒØ—o‘oˆŒÜ�8˜W×%Ò%Ø!Ÿ™ˆDŒJÜ�8˜X×&Ò&Ø#Ÿ?™?ˆDŽLñ 'r(   c                ó.   € V P                   P                  # r+   )rv   r<   rÍ   s   &r)   r<   ÚInverseJacobian.shapeì  ó   € à�}‰}×"Ñ"Ð"r(   c                ó.   € V P                   P                  # r+   )rv   r4   rÍ   s   &r)   r4   ÚInverseJacobian.dtypeð  rå   r(   )rv   r¿   rÀ   rh   rp   N)r"   r#   r$   r%   r&   rÞ   r   rß   r¬   Úpropertyr<   r4   r'   rµ   r¶   s   @r)   r   r   Ê  sD   ø‡ € ññ, $ LÓ1Ðò+ð ñ#ó ð#ð ñ#ó ö#r(   c                óü  a a€ \         P                  P                  P                  o\	        S \
        4      '       d   S # \        P                  ! S 4      '       d   \        S \
        4      '       d   S ! 4       # \	        S \        P                  4      '       d´   S P                  ^8”  d   \        R4      h\        P                  ! \        P                  ! S 4      4      o S P                  ^ ,          S P                  ^,          8w  d   \        R4      h\        V 3R lV 3R lRV 3R llRV 3R llS P                   S P                  R7      # \         P                  P#                  S 4      '       dp   S P                  ^ ,          S P                  ^,          8w  d   \        R4      h\        V 3R	 lV 3R
 lRV V3R llRV V3R llS P                   S P                  R7      # \%        S R4      '       dˆ   \%        S R4      '       dv   \%        S R4      '       dd   \        \'        S R4      \'        S R4      S P(                  \'        S R4      \'        S R4      \'        S R4      S P                   S P                  R7      # \+        S 4      '       d    ! V V3R lR\
        4      pV! 4       # \	        S \,        4      '       d;   \/        \0        \2        \4        \6        \8        \:        \<        R7      S ,          ! 4       # \?        R4      h)z=
Convert given object to one suitable for use as a Jacobian.
zarray must have rank <= 2zarray must be squarec                 ó   <€ \        SV 4      # r+   )r   ©rF   ÚJs   &€r)   Ú<lambda>Úasjacobian.<locals>.<lambda>  s   ø€ ¬¨Q°¬r(   c                 óL   <€ \        SP                  4       P                  V 4      # r+   )r   ÚconjÚTrë   s   &€r)   rí   rî     s   ø€ ¬#¨a¯f©f«h¯j©j¸!Ô*<r(   c                 ó   <€ \        SV 4      # r+   )r   ©rF   r[   rì   s   &&€r)   rí   rî     s   ø€ ¬u°Q¸¬{r(   c                 óL   <€ \        SP                  4       P                  V 4      # r+   )r   rð   rñ   ró   s   &&€r)   rí   rî     s   ø€ ´°a·f±f³h·j±jÀ!Ô0Dr(   )r¿   rÀ   r   rÁ   r4   r<   zmatrix must be squarec                 ó   <€ SV ,          # r+   r!   rë   s   &€r)   rí   rî     s	   ø€ ¨¨Q®r(   c                 óF   <€ SP                  4       P                  V ,          # r+   ©rð   rñ   rë   s   &€r)   rí   rî     s   ø€ ¨!¯&©&«(¯*©*°q®.r(   c                 ó   <€ S! SV 4      # r+   r!   ©rF   r[   rì   Úspsolves   &&€€r)   rí   rî     s   ø€ ©w°q¸!¬}r(   c                 óF   <€ S! SP                  4       P                  V 4      # r+   r÷   rù   s   &&€€r)   rí   rî     s   ø€ ±¸¿¹»¿
¹
ÀAÔ0Fr(   r<   r4   r   r¿   rÀ   rÁ   rp   rh   )r¿   rÀ   r   rÁ   rp   rh   r4   r<   c                   ód   <a € ] tR tRt o R tR	VV3R lltV3R ltR	VV3R lltV3R ltRt	V t
R# )
Úasjacobian.<locals>.Jaci  c                ó   € Wn         R # r+   r/   r×   s   &&&r)   rp   Úasjacobian.<locals>.Jac.update  s   € Ø–r(   c                óî   <€ S! V P                   4      p\        V\        P                  4      '       d   \	        W14      # \
        P                  P                  V4      '       d	   S! W14      # \        R 4      h©zUnknown matrix type)	r0   Ú
isinstancer,   Úndarrayr   ÚscipyÚsparseÚissparserk   ©r«   rF   r[   Úmrì   rú   s   &&& €€r)   r   Úasjacobian.<locals>.Jac.solve!  sV   ø€ Ù�d—f‘f“I�Ü˜a¤§¡×,Ò,Ü  ›;Ð&Ü—\‘\×*Ñ*¨1×-Ò-Ù" 1›=Ð(ä$Ð%:Ó;Ð;r(   c                óî   <€ S! V P                   4      p\        V\        P                  4      '       d   \	        W!4      # \
        P                  P                  V4      '       d	   W!,          # \        R 4      hr  )	r0   r  r,   r  r   r  r  r  rk   ©r«   rF   r  rì   s   && €r)   r¿   Úasjacobian.<locals>.Jac.matvec*  sS   ø€ Ù�d—f‘f“I�Ü˜a¤§¡×,Ò,Ü˜q›9Ð$Ü—\‘\×*Ñ*¨1×-Ò-Ø�5�Lä$Ð%:Ó;Ð;r(   c                óR  <€ S! V P                   4      p\        V\        P                  4      '       d%   \	        VP                  4       P                  V4      # \        P                  P                  V4      '       d"   S! VP                  4       P                  V4      # \        R 4      hr  )r0   r  r,   r  r   rð   rñ   r  r  r  rk   r  s   &&& €€r)   rÁ   Úasjacobian.<locals>.Jac.rsolve3  sp   ø€ Ù�d—f‘f“I�Ü˜a¤§¡×,Ò,Ü  §¡£§¡¨QÓ/Ð/Ü—\‘\×*Ñ*¨1×-Ò-Ù" 1§6¡6£8§:¡:¨qÓ1Ð1ä$Ð%:Ó;Ð;r(   c                óR  <€ S! V P                   4      p\        V\        P                  4      '       d%   \	        VP                  4       P                  V4      # \        P                  P                  V4      '       d"   VP                  4       P                  V,          # \        R 4      hr  )r0   r  r,   r  r   rð   rñ   r  r  r  rk   r  s   && €r)   rÀ   Úasjacobian.<locals>.Jac.rmatvec<  sm   ø€ Ù�d—f‘f“I�Ü˜a¤§¡×,Ò,Ü˜qŸv™v›xŸz™z¨1Ó-Ð-Ü—\‘\×*Ñ*¨1×-Ò-ØŸ6™6›8Ÿ:™:¨�>Ð)ä$Ð%:Ó;Ð;r(   r/   NrŽ   )r"   r#   r$   r%   rp   r   r¿   rÁ   rÀ   r'   rµ   )r·   rì   rú   s   @€€r)   ÚJacrý     s-   ù‡ € ò÷<ð <õ<÷<ð <÷<ó <r(   r  )r   r   r   r   r   r   Úkrylovz#Cannot convert object to a JacobianrŽ   ) r  r  Úlinalgrú   r  r¹   ÚinspectÚisclassÚ
issubclassr,   r  Úndimrk   Ú
atleast_2dr   r<   r4   r  rÆ   r=   r   ÚcallableÚstrÚdictr   ÚBroydenSecondÚAndersonÚDiagBroydenÚLinearMixingÚExcitingMixingr   Ú	TypeError)rì   r  rú   s   f @r)   rg   rg   õ  s!  ù€ ô �l‰l×!Ñ!×)Ñ)€GÜ�!”X×ÒØˆÜ	�Š˜×	Ò	¤
¨1¬h× 7Ò 7Ù‹sˆ
Ü	�A”r—z‘z×	"Ò	"Ø�6‰6�AŒ:ÜÐ8Ó9Ð9Ü�MŠMœ"Ÿ*š* Q›-Ó(ˆØ�7‰7�1�:˜Ÿ™ �Ô#ÜÐ3Ó4Ð4äÔ2Ü <Þ:ÞDØŸg™g¨Q¯W©Wô	6ð 	6ô
 
�‰×	Ñ	˜q×	!Ò	!Ø�7‰7�1�:˜Ÿ™ �Ô#ÜÐ4Ó5Ð5ÜœÜ 8ß<ßFØŸg™g¨Q¯W©Wô	6ð 	6ô
 
��G×	Ò	¤¨¨G×!4Ò!4¼ÀÀG×9LÒ9LÜœw q¨(Ó3Ü '¨¨9Ó 5ØŸg™gÜ& q¨(Ó3Ü& q¨(Ó3Ü% a¨Ó1ØŸg™gØŸg™gô'ð 	'ô 
�!�Š÷&	<ð &	<”(ô &	<ñN ‹uˆÜ	�A”s×	Ò	Üœ\Ü*Ü%Ü +Ü!-Ü#1Ü)ô+ð ,-ö.ó 0ð 	0ô Ð=Ó>Ð>r(   c                   óB   a € ] tR tRt o ]! ]4      tR tR tR t	Rt
V tR# )ÚGenericBroydeniU  c                ó  € \         P                  WW#4       W n        Wn        \	        V R 4      '       dW   V P
                  fG   \        V4      pV'       d+   R\        \        V4      ^4      ,          V,          V n        R# RV n        R# R# R# )ÚalphaNç      à?r\   )r¹   rh   Úlast_fÚlast_xrÆ   r%  r   r.   )r«   r>   Úf0rX   Únormf0s   &&&& r)   rh   ÚGenericBroyden.setupY  si   € Ü�‰�t Ô*ØŒØŒä�4˜×!Ò! d§j¡jÒ&8ô ˜"“XˆFßØ ¤¤T¨"£X¨qÓ!1Õ1°FÕ:�–
à �–
ñ '9Ñ!r(   c                ó   € \         hr+   rÑ   ©r«   r0   r°   r   Údfr³   Údf_norms   &&&&&&&r)   Ú_updateÚGenericBroyden._updateg  rÕ   r(   c           
     ó²   € W P                   ,
          pWP                  ,
          pV P                  WWC\        V4      \        V4      4       W n         Wn        R # r+   )r'  r(  r0  r   )r«   r0   r°   r.  r   s   &&&  r)   rp   ÚGenericBroyden.updatej  s<   € Ø—‘�_ˆØ—‘�_ˆØ�‰�Q˜2¤4¨£8¬T°"«XÔ6ØŒØŽr(   )r%  r'  r(  N)r"   r#   r$   r%   rÞ   r   rß   rh   r0  rp   r'   rµ   r¶   s   @r)   r#  r#  U  s$   ø‡ € á# LÓ1Ðò!ò"÷ð r(   r#  c                   ó¦   a € ] tR tRt o Rt]! ]4      tR t]	R 4       t
]	R 4       tR tR tRR ltRR	 ltR
 tRR ltR tR tR tRR ltRtV tR# )ÚLowRankMatrixir  zÌ
A matrix represented as

.. math:: \alpha I + \sum_{n=0}^{n=M} c_n d_n^\dagger

However, if the rank of the matrix reaches the dimension of the vectors,
full matrix representation will be used thereon.

c                óT   € Wn         . V n        . V n        W n        W0n        R V n        R # r+   )r%  Úcsrš   r†   r4   Ú	collapsed)r«   r%  r†   r4   s   &&&&r)   r¬   ÚLowRankMatrix.__init__€  s&   € ØŒ
ØˆŒØˆŒØŒØŒ
ØˆŽr(   c                ó¶   € \        . ROVR,          V .,           4      w  rEpW,          p\        W#4       F!  w  r‰V! W�4      p
V! W‡VP                  V
4      pK#  	  V# )ÚaxpyºNr˜   N)r;  ÚscalÚdotc)r   Úziprj   )rF   r%  r7  rš   r;  r=  r>  ÚwÚcÚdÚas   &&&&       r)   Ú_matvecÚLowRankMatrix._matvecˆ  sZ   € ä)Ò*BØ*,¨R­&°A°3­,ó8Ñˆ�Dà�IˆÜ˜–K‰DˆAÙ�Q“
ˆAÙ�Q˜1Ÿ6™6 1Ó%ŠAñ  ð ˆr(   c           	     óŒ  € \        V4      ^ 8X  d	   W,          # \        RR.VR,          V .,           4      w  rEV^ ,          pV\        P                  ! \        V4      VP                  R7      ,          p\        V4       F5  w  r‰\        V4       F!  w  r«WxV
3;;,          V! W›4      ,          uu&   K#  	  K7  	  \        P                  ! \        V4      VP                  R7      p\        V4       F  w  r©V! W�4      WÊ&   K  	  WÁ,          p\        W|4      pW,          p\        W,4       F  w  r¾V! W½VP                  V) 4      pK  	  V# )úEvaluate w = M^-1 vr;  r>  r<  r3   )
Úlenr   r,   Úidentityr4   Ú	enumerateÚzerosr   r?  rj   )rF   r%  r7  rš   r;  r>  Úc0ÚAÚirB  ÚjrA  Úqr@  Úqcs   &&&&           r)   Ú_solveÚLowRankMatrix._solve’  s  € ô ˆr‹7�aŒ<Ø•7ˆNô $ V¨VÐ$4°b¸µfÀ¸sµlÓC‰
ˆà��UˆØ”B—K’K¤ B£¨r¯x©xÔ8Õ8ˆÜ˜b–M‰DˆAÜ! "ž‘�Ø�A�#—™$˜q›*Õ$•ó &ñ "ô �HŠH”S˜“W B§H¡HÔ-ˆÜ˜b–M‰DˆAÙ˜“:ˆA‹Dñ "à	�
ˆÜ�!‹Kˆà�GˆÜ˜–Z‰EˆAÙ�Q˜1Ÿ6™6 B 3Ó'ŠAñ  ð ˆr(   c                óÊ   € V P                   e"   \        P                  ! V P                   V4      # \        P	                  WP
                  V P                  V P                  4      # )zEvaluate w = M v)r8  r,   r   r5  rD  r%  r7  rš   ©r«   rF   s   &&r)   r¿   ÚLowRankMatrix.matvec®  sB   € à�>‰>Ò%Ü—6’6˜$Ÿ.™.¨!Ó,Ð,Ü×$Ñ$ Q¯
©
°D·G±G¸T¿W¹WÓEÐEr(   c                ó$  € V P                   e:   \        P                  ! V P                   P                  P	                  4       V4      # \
        P                  V\        P                  ! V P                  4      V P                  V P                  4      # )zEvaluate w = M^H v)
r8  r,   r   rñ   rð   r5  rD  r%  rš   r7  rU  s   &&r)   rÀ   ÚLowRankMatrix.rmatvec´  s\   € à�>‰>Ò%Ü—6’6˜$Ÿ.™.×*Ñ*×/Ñ/Ó1°1Ó5Ð5Ü×$Ñ$ Q¬¯ª°·
±
Ó(;¸T¿W¹WÀdÇgÁgÓNÐNr(   c                ó´   € V P                   e   \        V P                   V4      # \        P                  WP                  V P
                  V P                  4      # )rG  )r8  r   r5  rR  r%  r7  rš   rÓ   s   &&&r)   r   ÚLowRankMatrix.solveº  s>   € à�>‰>Ò%Ü˜Ÿ™¨Ó+Ð+Ü×#Ñ# A§z¡z°4·7±7¸D¿G¹GÓDÐDr(   c                ó  € V P                   e/   \        V P                   P                  P                  4       V4      # \        P                  V\        P                  ! V P                  4      V P                  V P                  4      # )zEvaluate w = M^-H v)
r8  r   rñ   rð   r5  rR  r,   r%  rš   r7  rÓ   s   &&&r)   rÁ   ÚLowRankMatrix.rsolveÀ  sX   € à�>‰>Ò%Ü˜Ÿ™×)Ñ)×.Ñ.Ó0°!Ó4Ð4Ü×#Ñ# A¤r§w¢w¨t¯z©zÓ':¸D¿G¹GÀTÇWÁWÓMÐMr(   c                óv  € V P                   e?   V ;P                   VR,          VR,          P                  4       ,          ,          un         R # V P                  P                  V4       V P                  P                  V4       \        V P                  4      VP                  8”  d   V P                  4        R # R # )N©ºNNNN©Nr_  )r8  rð   r7  Úappendrš   rH  rj   Úcollapse)r«   rA  rB  s   &&&r)   ra  ÚLowRankMatrix.appendÆ  ss   € Ø�>‰>Ò%Ø�NŠN˜a �i¨!¨F­)¯.©.Ó*:Õ:Õ:�NÙà�‰�‰�qÔØ�‰�‰�qÔäˆt�w‰w‹<˜!Ÿ&™&Ô Ø�M‰MŽOñ !r(   Nc                óÜ  € Ve   \         P                  ! RV R2^R7       Ve   \         P                  ! RV R2^R7       V P                  e   V P                  # V P                  \        P
                  ! V P                  V P                  R7      ,          p\        V P                  V P                  4       F0  w  rEW4R,          VR,          P                  4       ,          ,          pK2  	  V# )NzJLowRankMatrix is scipy-internal code, `dtype` should only be None but was z (not handled))Ú
stacklevelzILowRankMatrix is scipy-internal code, `copy` should only be None but was r3   r^  r`  )ÚwarningsÚwarnr8  r%  r,   rI  r†   r4   r?  r7  rš   rð   )r«   r4   ri   ÚGmrA  rB  s   &&&   r)   r½   ÚLowRankMatrix.__array__Ñ  sÅ   € ØÒÜ�MŠMð 9Ø9>¸¸~ðOà%&õ(ð ÒÜ�MŠMð 9Ø9=¸¸nðNà%&õ(ð �>‰>Ò%Ø—>‘>Ð!à�Z‰ZœŸš D§F¡F°$·*±*Ô=Õ=ˆÜ˜Ÿ™ §¡Ö)‰DˆAØ�F•)˜A˜f�IŸN™NÓ,Õ,Õ,ŠBñ *àˆ	r(   c                ór   € \         P                  ! V \        R7      V n        RV n        RV n        RV n        R# )z0Collapse the low-rank matrix to a full-rank one.)ri   N)r,   rD   r   r8  r7  rš   r%  rÍ   s   &r)   rb  ÚLowRankMatrix.collapseâ  s)   € äŸš $¬^Ô<ˆŒØˆŒØˆŒØˆŽ
r(   c                ó¤   € V P                   e   R# V^ 8”  g   Q h\        V P                  4      V8”  d   V P                  R V P                  R R# R# )z8
Reduce the rank of the matrix by dropping all vectors.
Nr_  ©r8  rH  r7  rš   ©r«   Úranks   &&r)   Úrestart_reduceÚLowRankMatrix.restart_reduceé  sG   € ð �>‰>Ò%ÙØ�aŒxˆˆxÜˆt�w‰w‹<˜$ÔØ—‘˜�
Ø—‘˜’
ñ r(   c                ó¤   € V P                   e   R# V^ 8”  g   Q h\        V P                  4      V8”  d   V P                  ^  V P                  ^  K6  R# )z;
Reduce the rank of the matrix by dropping oldest vectors.
Nrm  rn  s   &&r)   Úsimple_reduceÚLowRankMatrix.simple_reduceô  sG   € ð �>‰>Ò%ÙØ�aŒxˆˆxÜ�$—'‘'‹l˜TÔ!Ø—‘˜�
Ø—‘˜’
ñ "r(   c                óÀ  € V P                   e   R# TpVe   TpM	V^,
          pV P                  '       d'   \        V\        V P                  ^ ,          4      4      p\	        ^ \        WC^,
          4      4      p\        V P                  4      pWS8  d   R# \
        P                  ! V P                  4      P                  p\
        P                  ! V P                  4      P                  p\        VRR7      w  rx\        WhP                  P                  4       4      p\        VRR7      w  ršp\        V\        V4      4      p\        W{P                  P                  4       4      p\        V4       FO  pVRV3,          P                  4       V P                  V&   VRV3,          P                  4       V P                  V&   KQ  	  V P                  VR1 V P                  VR1 R# )al  
Reduce the rank of the matrix by retaining some SVD components.

This corresponds to the "Broyden Rank Reduction Inverse"
algorithm described in [1]_.

Note that the SVD decomposition can be done by solving only a
problem whose size is the effective rank of this matrix, which
is viable even for large problems.

Parameters
----------
max_rank : int
    Maximum rank of this matrix after reduction.
to_retain : int, optional
    Number of SVD components to retain when reduction is done
    (ie. rank > max_rank). Default is ``max_rank - 2``.

References
----------
.. [1] B.A. van der Rotten, PhD thesis,
   "A limited memory Broyden method to solve high-dimensional
   systems of nonlinear equations". Mathematisch Instituut,
   Universiteit Leiden, The Netherlands (2003).

   https://web.archive.org/web/20161022015821/http://www.math.leidenuniv.nl/scripties/Rotten.pdf

NÚeconomic)ÚmodeF)Úfull_matricesr_  )r8  r7  rn   rH  r.   r,   rD   rñ   rš   r	   r   rð   r
   r   rl   ri   )r«   Úmax_rankÚ	to_retainr‘   rP  r  ÚCÚDÚRÚUÚSÚWHÚks   &&&          r)   Ú
svd_reduceÚLowRankMatrix.svd_reduceÿ  sY  € ð: �>‰>Ò%ÙàˆØÒ Ø‰Aà�A•ˆAà�7�7ˆ7Ü�A”s˜4Ÿ7™7 1�:“Ó'ˆAÜ�”3�q˜A�#“;Óˆä�—‘‹LˆØŒ5áä�HŠH�T—W‘WÓ×ÑˆÜ�HŠH�T—W‘WÓ×Ñˆä�!˜*Ô%‰ˆÜ�—3‘3—8‘8“:Óˆä�q¨Ô.‰ˆˆbä�”3�r“7‹OˆÜ�—4‘4—9‘9“;Óˆä�q–ˆAØ˜1˜Q˜3�Ÿ™›ˆD�G‰G�A‰JØ˜1˜Q˜3�Ÿ™›ˆD�G‰G�A‹Jñ ð �G‰G�A‘BˆKØ�G‰G�A‘BŠKr(   )r%  r8  r7  rš   r4   r†   rŽ   rÃ   r+   )r"   r#   r$   r%   r&   rÞ   r   rß   r¬   ÚstaticmethodrD  rR  r¿   rÀ   r   rÁ   ra  r½   rb  rp  rs  r‚  r'   rµ   r¶   s   @r)   r5  r5  r  s   ø‡ € ññ $ LÓ1Ðòð ñó ðð ñó ðò6FòOôEôNò	ôò"ò	ò	÷?ò ?r(   r5  aÔ  
    alpha : float, optional
        Initial guess for the Jacobian is ``(-1/alpha)``.
    reduction_method : str or tuple, optional
        Method used in ensuring that the rank of the Broyden matrix
        stays low. Can either be a string giving the name of the method,
        or a tuple of the form ``(method, param1, param2, ...)``
        that gives the name of the method and values for additional parameters.

        Methods available:

        - ``restart``: drop all matrix columns. Has no extra parameters.
        - ``simple``: drop oldest matrix column. Has no extra parameters.
        - ``svd``: keep only the most significant SVD components.
          Takes an extra parameter, ``to_retain``, which determines the
          number of SVD components to retain when rank reduction is done.
          Default is ``max_rank - 2``.

    max_rank : int, optional
        Maximum rank for the Broyden matrix.
        Default is infinity (i.e., no rank reduction).
    Úbroyden_paramsc                   ó`   a € ] tR tRt o RtRR ltR tR tRR ltR t	RR	 lt
R
 tR tRtV tR# )r   iY  aÜ  
Find a root of a function, using Broyden's first Jacobian approximation.

This method is also known as "Broyden's good method".

Parameters
----------
%(params_basic)s
%(broyden_params)s
%(params_extra)s

See Also
--------
root : Interface to root finding algorithms for multivariate
       functions. See ``method='broyden1'`` in particular.

Notes
-----
This algorithm implements the inverse Jacobian Quasi-Newton update

.. math:: H_+ = H + (dx - H df) dx^\dagger H / ( dx^\dagger H df)

which corresponds to Broyden's first Jacobian update

.. math:: J_+ = J + (df - J dx) dx^\dagger / dx^\dagger dx


References
----------
.. [1] B.A. van der Rotten, PhD thesis,
   "A limited memory Broyden method to solve high-dimensional
   systems of nonlinear equations". Mathematisch Instituut,
   Universiteit Leiden, The Netherlands (2003).
   https://math.leidenuniv.nl/scripties/Rotten.pdf

Examples
--------
The following functions define a system of nonlinear equations

>>> def fun(x):
...     return [x[0]  + 0.5 * (x[0] - x[1])**3 - 1.0,
...             0.5 * (x[1] - x[0])**3 + x[1]]

A solution can be obtained as follows.

>>> from scipy import optimize
>>> sol = optimize.broyden1(fun, [0, 0])
>>> sol
array([0.84116396, 0.15883641])

Nc                ó–  a a€ \         P                  S 4       VS n        R S n        Vf   \        P
                  pVS n        \        V\        4      '       d   R
oMVR,          oV^ ,          pV^,
          3S,           oVR8X  d   VV 3R lS n	        R # VR8X  d   VV 3R lS n	        R # VR8X  d   VV 3R lS n	        R # \        RV R	24      h)N:r˜   NNr
   c                  ó8   <€ SP                   P                  ! S !  # r+   )rh  r‚  ©Úreduce_paramsr«   s   €€r)   rí   Ú'BroydenFirst.__init__.<locals>.<lambda>Ÿ  s   ø€  4§7¡7×#5Ò#5°}Ò#Er(   Úsimplec                  ó8   <€ SP                   P                  ! S !  # r+   )rh  rs  r‰  s   €€r)   rí   r‹  ¡  s   ø€  4§7¡7×#8Ò#8¸-Ò#Hr(   Úrestartc                  ó8   <€ SP                   P                  ! S !  # r+   )rh  rp  r‰  s   €€r)   rí   r‹  £  s   ø€  4§7¡7×#9Ò#9¸=Ò#Ir(   zUnknown rank reduction method 'Ú'r!   )r#  r¬   r%  rh  r,   rE   ry  r  r  Ú_reducerk   )r«   r%  Úreduction_methodry  rŠ  s   f&&&@r)   r¬   ÚBroydenFirst.__init__Ž  s²   ù€ Ü×Ñ Ô%ØˆŒ
ØˆŒàÒÜ—v‘vˆHØ ˆŒäÐ&¬×,Ò,Ø‰Mà,¨RÕ0ˆMØ/°Õ2ÐØ! A�˜¨-Õ7ˆà˜uÔ$ÝEˆDŽLØ Ô)ÝHˆDŽLØ Ô*ÝIˆDŽLäÐ>Ð?OÐ>PÐPQÐRÓSÐSr(   c                ó¢   € \         P                  WW#4       \        V P                  ) V P                  ^ ,          V P
                  4      V n        R# )r   N)r#  rh   r5  r%  r<   r4   rh  rÜ   s   &&&&r)   rh   ÚBroydenFirst.setup§  s4   € Ü×Ñ˜T aÔ.Ü §¡ ¨T¯Z©Z¸­]¸D¿J¹JÓGˆŽr(   c                ó,   € \        V P                  4      # r+   )r   rh  rÍ   s   &r)   r»   ÚBroydenFirst.todense«  s   € Ü�4—7‘7‹|Ðr(   c                ó(  € V P                   P                  V4      p\        P                  ! V4      P	                  4       '       gM   V P                  V P                  V P                  V P                  4       V P                   P                  V4      # V# r+   )	rh  r¿   r,   rB   rC   rh   r(  r'  rX   )r«   r°   r[   Úrs   &&& r)   r   ÚBroydenFirst.solve®  s_   € Ø�G‰G�N‰N˜1ÓˆÜ�{Š{˜1‹~×!Ñ!×#Ò#à�J‰J�t—{‘{ D§K¡K°·±Ô;Ø—7‘7—>‘> !Ó$Ð$Øˆr(   c                ó8   € V P                   P                  V4      # r+   )rh  r   ©r«   r°   s   &&r)   r¿   ÚBroydenFirst.matvec¶  s   € Ø�w‰w�}‰}˜QÓÐr(   c                ó8   € V P                   P                  V4      # r+   )rh  rÀ   ©r«   r°   r[   s   &&&r)   rÁ   ÚBroydenFirst.rsolve¹  s   € Ø�w‰w�‰˜qÓ!Ð!r(   c                ó8   € V P                   P                  V4      # r+   )rh  rÁ   rœ  s   &&r)   rÀ   ÚBroydenFirst.rmatvec¼  s   € Ø�w‰w�~‰~˜aÓ Ð r(   c                óø   € V P                  4        V P                  P                  V4      pW0P                  P                  V4      ,
          pV\	        WG4      ,          p	V P                  P                  W‰4       R # r+   )r‘  rh  rÀ   r¿   r   ra  ©
r«   r0   r°   r   r.  r³   r/  rF   rA  rB  s
   &&&&&&&   r)   r0  ÚBroydenFirst._update¿  sO   € Ø�‰Œà�G‰G�O‰O˜BÓˆØ—‘—‘ Ó#Õ#ˆØ”�R“�Oˆà�‰�‰�qÖr(   )rh  r‘  r%  ry  )NrŽ  NrŽ   )r"   r#   r$   r%   r&   r¬   rh   r»   r   r¿   rÁ   rÀ   r0  r'   rµ   r¶   s   @r)   r   r   Y  s:   ø‡ € ñ2ôhTò2Hòôò ô"ò!÷ð r(   c                   ó*   a € ] tR tRt o RtR tRtV tR# )r  iÉ  a¿  
Find a root of a function, using Broyden's second Jacobian approximation.

This method is also known as "Broyden's bad method".

Parameters
----------
%(params_basic)s
%(broyden_params)s
%(params_extra)s

See Also
--------
root : Interface to root finding algorithms for multivariate
       functions. See ``method='broyden2'`` in particular.

Notes
-----
This algorithm implements the inverse Jacobian Quasi-Newton update

.. math:: H_+ = H + (dx - H df) df^\dagger / ( df^\dagger df)

corresponding to Broyden's second method.

References
----------
.. [1] B.A. van der Rotten, PhD thesis,
   "A limited memory Broyden method to solve high-dimensional
   systems of nonlinear equations". Mathematisch Instituut,
   Universiteit Leiden, The Netherlands (2003).

   https://web.archive.org/web/20161022015821/http://www.math.leidenuniv.nl/scripties/Rotten.pdf

Examples
--------
The following functions define a system of nonlinear equations

>>> def fun(x):
...     return [x[0]  + 0.5 * (x[0] - x[1])**3 - 1.0,
...             0.5 * (x[1] - x[0])**3 + x[1]]

A solution can be obtained as follows.

>>> from scipy import optimize
>>> sol = optimize.broyden2(fun, [0, 0])
>>> sol
array([0.84116365, 0.15883529])

c                óÀ   € V P                  4        TpW0P                  P                  V4      ,
          pWv^,          ,          p	V P                  P                  W‰4       R# ©é   N)r‘  rh  r¿   ra  r¤  s
   &&&&&&&   r)   r0  ÚBroydenSecond._updateü  s@   € Ø�‰ŒàˆØ—‘—‘ Ó#Õ#ˆØ˜•
�NˆØ�‰�‰�qÖr(   r!   N)r"   r#   r$   r%   r&   r0  r'   rµ   r¶   s   @r)   r  r  É  s   ø‡ € ñ0÷dð r(   r  c                   óD   a € ] tR tRt o RtR	R ltR
R ltR tR tRt	V t
R# )r  i	  az  
Find a root of a function, using (extended) Anderson mixing.

The Jacobian is formed by for a 'best' solution in the space
spanned by last `M` vectors. As a result, only a MxM matrix
inversions and MxN multiplications are required. [Ey]_

Parameters
----------
%(params_basic)s
alpha : float, optional
    Initial guess for the Jacobian is (-1/alpha).
M : float, optional
    Number of previous vectors to retain. Defaults to 5.
w0 : float, optional
    Regularization parameter for numerical stability.
    Compared to unity, good values of the order of 0.01.
%(params_extra)s

See Also
--------
root : Interface to root finding algorithms for multivariate
       functions. See ``method='anderson'`` in particular.

References
----------
.. [Ey] V. Eyert, J. Comp. Phys., 124, 271 (1996).

Examples
--------
The following functions define a system of nonlinear equations

>>> def fun(x):
...     return [x[0]  + 0.5 * (x[0] - x[1])**3 - 1.0,
...             0.5 * (x[1] - x[0])**3 + x[1]]

A solution can be obtained as follows.

>>> from scipy import optimize
>>> sol = optimize.anderson(fun, [0, 0])
>>> sol
array([0.84116588, 0.15883789])

Nc                ó~   € \         P                  V 4       Wn        W0n        . V n        . V n        R V n        W n        R # r+   )r#  r¬   r%  ÚMr   r.  r‚   Úw0)r«   r%  r®  r­  s   &&&&r)   r¬   ÚAnderson.__init__P  s4   € Ü×Ñ Ô%ØŒ
ØŒØˆŒØˆŒØˆŒ
ØŽr(   c                óZ  € V P                   ) V,          p\        V P                  4      pV^ 8X  d   V# \        P                  ! WAP
                  R7      p\        V4       F"  p\        V P                  V,          V4      WV&   K$  	   \        V P                  V4      p\        T4       FS  pY7T,          T P                  T,          T P                   T P                  T,          ,          ,           ,          ,          pKU  	  T#   \         d     T P                  R T P                  R Tu # i ; i)r   r3   r_  )r%  rH  r   r,   Úemptyr4   rl   r   r.  r   rC  r   )	r«   r°   r[   r   r†   Údf_fr�  r‚   r  s	   &&&      r)   r   ÚAnderson.solveY  så   € Ø�j‰jˆ[˜�]ˆä�—‘‹LˆØ�Œ6ØˆIä�xŠx˜§¡Ô)ˆÜ�q–ˆAÜ˜4Ÿ7™7 1�: qÓ)ˆD‹Gñ ð	Ü˜$Ÿ&™& $Ó'ˆEô �q–ˆAØ˜•(˜DŸG™G A�J¨¯©°D·G±G¸AµJÕ)>Õ>Õ?Õ?ŠBñ àˆ	øô ô 	à—‘˜�
Ø—‘˜�
ØŠIð		ús   ÂD  Ä 'D*Ä)D*c           
     óæ  € V) V P                   ,          p\        V P                  4      pV^ 8X  d   V# \        P                  ! W1P
                  R7      p\        V4       F"  p\        V P                  V,          V4      WE&   K$  	  \        P                  ! W33VP
                  R7      p\        V4       FÍ  p\        V4       F»  p\        V P                  V,          V P                  V,          4      WgV3&   Wx8X  g   K=  V P                  ^ 8w  g   KP  WgV3;;,          \        V P                  V,          V P                  V,          4      V P                  ^,          ,          V P                   ,          ,          uu&   K½  	  KÏ  	  \        Wd4      p	\        V4       FS  p
W)V
,          V P                  V
,          V P                  V
,          V P                   ,          ,           ,          ,          pKU  	  V# )r   r3   )r%  rH  r   r,   r±  r4   rl   r   r.  r®  r   )r«   r°   r   r†   r²  r�  ÚbrN  rO  r‚   r  s   &&         r)   r¿   ÚAnderson.matvecp  sO  € ØˆR�—
‘
�]ˆä�—‘‹LˆØ�Œ6ØˆIä�xŠx˜§¡Ô)ˆÜ�q–ˆAÜ˜4Ÿ7™7 1�: qÓ)ˆD‹Gñ ô �HŠH�a�V 1§7¡7Ô+ˆÜ�q–ˆAÜ˜1–X�Ü˜dŸg™g a�j¨$¯'©'°!­*Ó5��A�#‘Ø–6˜dŸg™g¨žlØ˜�c—Fœd 4§7¡7¨1¥:¨t¯w©w°q­zÓ:¸4¿7¹7ÀA½:ÕEÀdÇjÁjÕPÕP•Fó ñ ô
 �a“ˆä�q–ˆAØ˜•(˜DŸG™G A�J¨¯©°­°D·J±JÕ)>Õ>Õ?Õ?ŠBñ àˆ	r(   c                ó8  € V P                   ^ 8X  d   R# V P                  P                  V4       V P                  P                  V4       \	        V P                  4      V P                   8”  d9   V P                  P                  ^ 4       V P                  P                  ^ 4       K\  \	        V P                  4      p\        P                  ! Ww3VP                  R7      p\        V4       Fq  p	\        W—4       F_  p
Wš8X  d   V P                  ^,          pM^ p^V,           \        V P                  V	,          V P                  V
,          4      ,          W‰V
3&   Ka  	  Ks  	  V\        P                  ! V^4      P                  P                  4       ,          pW€n        R# )r   Nr3   )r­  r   ra  r.  rH  Úpopr,   rK  r4   rl   r®  r   Útriurñ   rð   rC  )r«   r0   r°   r   r.  r³   r/  r†   rC  rN  rO  Úwds   &&&&&&&     r)   r0  ÚAnderson._update‡  s  € Ø�6‰6�QŒ;Ùà�‰�‰�rÔØ�‰�‰�rÔä�$—'‘'‹l˜TŸV™VÔ#Ø�G‰G�K‰K˜ŒNØ�G‰G�K‰K˜ŽNä�—‘‹LˆÜ�HŠH�a�V 1§7¡7Ô+ˆä�q–ˆAÜ˜1–[�Ø”6ØŸ™ !�‘Bà�BØ˜B�$¤ T§W¡W¨Q¥Z°·±¸µÓ <Õ<��A�#“ó !ñ ð 	
ŒR�WŠW�Q˜‹]�_‰_×!Ñ!Ó#Õ#ˆØŽr(   )r­  rC  r%  r.  r   r‚   r®  )NrŸ   é   rŽ   )r"   r#   r$   r%   r&   r¬   r   r¿   r0  r'   rµ   r¶   s   @r)   r  r  	  s$   ø‡ € ñ+ôLôò.÷.ð r(   r  c                   ó`   a € ] tR tRt o RtRR ltR tRR ltR tRR lt	R	 t
R
 tR tRtV tR# )r  i¥  a¼  
Find a root of a function, using diagonal Broyden Jacobian approximation.

The Jacobian approximation is derived from previous iterations, by
retaining only the diagonal of Broyden matrices.

.. warning::

   This algorithm may be useful for specific problems, but whether
   it will work may depend strongly on the problem.

Parameters
----------
%(params_basic)s
alpha : float, optional
    Initial guess for the Jacobian is (-1/alpha).
%(params_extra)s

See Also
--------
root : Interface to root finding algorithms for multivariate
       functions. See ``method='diagbroyden'`` in particular.

Examples
--------
The following functions define a system of nonlinear equations

>>> def fun(x):
...     return [x[0]  + 0.5 * (x[0] - x[1])**3 - 1.0,
...             0.5 * (x[1] - x[0])**3 + x[1]]

A solution can be obtained as follows.

>>> from scipy import optimize
>>> sol = optimize.diagbroyden(fun, [0, 0])
>>> sol
array([0.84116403, 0.15883384])

Nc                ó<   € \         P                  V 4       Wn        R # r+   ©r#  r¬   r%  ©r«   r%  s   &&r)   r¬   ÚDiagBroyden.__init__Î  ó   € Ü×Ñ Ô%ØŽ
r(   c                óÈ   € \         P                  WW#4       \        P                  ! V P                  ^ ,          3^V P
                  ,          V P                  R7      V n        R# ©r   r3   N)r#  rh   r,   Úfullr<   r%  r4   rB  rÜ   s   &&&&r)   rh   ÚDiagBroyden.setupÒ  s=   € Ü×Ñ˜T aÔ.Ü—’˜$Ÿ*™* Q�-Ð)¨1¨t¯z©z­>ÀÇÁÔLˆŽr(   c                ó*   € V) V P                   ,          # r+   ©rB  rŸ  s   &&&r)   r   ÚDiagBroyden.solveÖ  ó   € Øˆr�D—F‘F�{Ðr(   c                ó*   € V) V P                   ,          # r+   rÈ  rœ  s   &&r)   r¿   ÚDiagBroyden.matvecÙ  rÊ  r(   c                óF   € V) V P                   P                  4       ,          # r+   ©rB  rð   rŸ  s   &&&r)   rÁ   ÚDiagBroyden.rsolveÜ  ó   € Øˆr�D—F‘F—K‘K“MÕ!Ð!r(   c                óF   € V) V P                   P                  4       ,          # r+   rÎ  rœ  s   &&r)   rÀ   ÚDiagBroyden.rmatvecß  rÐ  r(   c                óD   € \         P                  ! V P                  ) 4      # r+   )r,   ÚdiagrB  rÍ   s   &r)   r»   ÚDiagBroyden.todenseâ  s   € Ü�wŠw˜Ÿ™�wÓÐr(   c                ó�   € V ;P                   W@P                   V,          ,           V,          V^,          ,          ,          un         R# r¨  rÈ  r-  s   &&&&&&&r)   r0  ÚDiagBroyden._updateå  s(   € Ø�Š�2Ÿ™˜r�	•> 2Õ% g¨q¥jÕ0Õ0�r(   )r%  rB  r+   rŽ   ©r"   r#   r$   r%   r&   r¬   rh   r   r¿   rÁ   rÀ   r»   r0  r'   rµ   r¶   s   @r)   r  r  ¥  s9   ø‡ € ñ&ôPòMôòô"ò"ò ÷1ð 1r(   r  c                   óZ   a € ] tR tRt o RtRR ltRR ltR tRR ltR t	R	 t
R
 tRtV tR# )r  ié  aØ  
Find a root of a function, using a scalar Jacobian approximation.

.. warning::

   This algorithm may be useful for specific problems, but whether
   it will work may depend strongly on the problem.

Parameters
----------
%(params_basic)s
alpha : float, optional
    The Jacobian approximation is (-1/alpha).
%(params_extra)s

See Also
--------
root : Interface to root finding algorithms for multivariate
       functions. See ``method='linearmixing'`` in particular.

Nc                ó<   € \         P                  V 4       Wn        R # r+   r¿  rÀ  s   &&r)   r¬   ÚLinearMixing.__init__   rÂ  r(   c                ó*   € V) V P                   ,          # r+   ©r%  rŸ  s   &&&r)   r   ÚLinearMixing.solve  ó   € Øˆr�$—*‘*�}Ðr(   c                ó*   € V) V P                   ,          # r+   rÝ  rœ  s   &&r)   r¿   ÚLinearMixing.matvec  rß  r(   c                óR   € V) \         P                  ! V P                  4      ,          # r+   ©r,   rð   r%  rŸ  s   &&&r)   rÁ   ÚLinearMixing.rsolve
  ó   € Øˆr”"—'’'˜$Ÿ*™*Ó%Õ%Ð%r(   c                óR   € V) \         P                  ! V P                  4      ,          # r+   rã  rœ  s   &&r)   rÀ   ÚLinearMixing.rmatvec  rå  r(   c                óœ   € \         P                  ! \         P                  ! V P                  ^ ,          RV P                  ,          4      4      # )r   éÿÿÿÿ)r,   rÔ  rÅ  r<   r%  rÍ   s   &r)   r»   ÚLinearMixing.todense  s,   € Ü�wŠw”r—w’w˜tŸz™z¨!�}¨b°·±­mÓ<Ó=Ð=r(   c                ó   € R # r+   r!   r-  s   &&&&&&&r)   r0  ÚLinearMixing._update  rÙ   r(   rÝ  r+   rŽ   )r"   r#   r$   r%   r&   r¬   r   r¿   rÁ   rÀ   r»   r0  r'   rµ   r¶   s   @r)   r  r  é  s2   ø‡ € ñô,ôòô&ò&ò>÷ð r(   r  c                   ó`   a € ] tR tRt o RtRR ltR tRR ltR tRR lt	R	 t
R
 tR tRtV tR# )r   i  a›  
Find a root of a function, using a tuned diagonal Jacobian approximation.

The Jacobian matrix is diagonal and is tuned on each iteration.

.. warning::

   This algorithm may be useful for specific problems, but whether
   it will work may depend strongly on the problem.

See Also
--------
root : Interface to root finding algorithms for multivariate
       functions. See ``method='excitingmixing'`` in particular.

Parameters
----------
%(params_basic)s
alpha : float, optional
    Initial Jacobian approximation is (-1/alpha).
alphamax : float, optional
    The entries of the diagonal Jacobian are kept in the range
    ``[alpha, alphamax]``.
%(params_extra)s
Nc                óV   € \         P                  V 4       Wn        W n        R V n        R # r+   )r#  r¬   r%  ÚalphamaxÚbeta)r«   r%  rï  s   &&&r)   r¬   ÚExcitingMixing.__init__2  s!   € Ü×Ñ Ô%ØŒ
Ø ŒØˆŽ	r(   c                óº   € \         P                  WW#4       \        P                  ! V P                  ^ ,          3V P
                  V P                  R7      V n        R# rÄ  )r#  rh   r,   rÅ  r<   r%  r4   rð  rÜ   s   &&&&r)   rh   ÚExcitingMixing.setup8  s9   € Ü×Ñ˜T aÔ.Ü—G’G˜TŸZ™Z¨�]Ð,¨d¯j©jÀÇ
Á
ÔKˆŽ	r(   c                ó*   € V) V P                   ,          # r+   ©rð  rŸ  s   &&&r)   r   ÚExcitingMixing.solve<  ó   € Øˆr�$—)‘)�|Ðr(   c                ó*   € V) V P                   ,          # r+   rõ  rœ  s   &&r)   r¿   ÚExcitingMixing.matvec?  r÷  r(   c                óF   € V) V P                   P                  4       ,          # r+   ©rð  rð   rŸ  s   &&&r)   rÁ   ÚExcitingMixing.rsolveB  ó   € Øˆr�$—)‘)—.‘.Ó"Õ"Ð"r(   c                óF   € V) V P                   P                  4       ,          # r+   rû  rœ  s   &&r)   rÀ   ÚExcitingMixing.rmatvecE  rý  r(   c                óP   € \         P                  ! RV P                  ,          4      # )r˜   ré  )r,   rÔ  rð  rÍ   s   &r)   r»   ÚExcitingMixing.todenseH  s   € Ü�wŠw�r˜$Ÿ)™)•|Ó$Ð$r(   c                ó&  € W P                   ,          ^ 8„  pV P                  V;;,          V P                  ,          uu&   V P                  V P                  V( &   \        P                  ! V P                  ^ V P
                  V P                  R7       R# )r   )ÚoutN)r'  rð  r%  r,   Úcliprï  )r«   r0   r°   r   r.  r³   r/  Úincrs   &&&&&&& r)   r0  ÚExcitingMixing._updateK  sZ   € Ø—‘�}˜qÑ ˆØ�	‰	�$�˜4Ÿ:™:Õ%‹ØŸ:™:ˆ�	‰	�4�%ÑÜ
�Š�—	‘	˜1˜dŸm™m°·±×;r(   )r%  rï  rð  )Nr\   rŽ   rØ  r¶   s   @r)   r   r     s8   ø‡ € ñô4òLôòô#ò#ò%÷<ð <r(   r   c                   óP   a € ] tR tRt o RtRR ltR tR tRR ltR t	R	 t
R
tV tR# )r   iV  a\  
Find a root of a function, using Krylov approximation for inverse Jacobian.

This method is suitable for solving large-scale problems.

Parameters
----------
%(params_basic)s
rdiff : float, optional
    Relative step size to use in numerical differentiation.
method : str or callable, optional
    Krylov method to use to approximate the Jacobian.  Can be a string,
    or a function implementing the same interface as the iterative
    solvers in `scipy.sparse.linalg`. If a string, needs to be one of:
    ``'lgmres'``, ``'gmres'``, ``'bicgstab'``, ``'cgs'``, ``'minres'``,
    ``'tfqmr'``.

    The default is `scipy.sparse.linalg.lgmres`.
inner_maxiter : int, optional
    Parameter to pass to the "inner" Krylov solver: maximum number of
    iterations. Iteration will stop after maxiter steps even if the
    specified tolerance has not been achieved.
inner_M : LinearOperator or InverseJacobian
    Preconditioner for the inner Krylov iteration.
    Note that you can use also inverse Jacobians as (adaptive)
    preconditioners. For example,

    >>> from scipy.optimize import BroydenFirst, KrylovJacobian
    >>> from scipy.optimize import InverseJacobian
    >>> jac = BroydenFirst()
    >>> kjac = KrylovJacobian(inner_M=InverseJacobian(jac))

    If the preconditioner has a method named 'update', it will be called
    as ``update(x, f)`` after each nonlinear step, with ``x`` giving
    the current point, and ``f`` the current function value.
outer_k : int, optional
    Size of the subspace kept across LGMRES nonlinear iterations.
    See `scipy.sparse.linalg.lgmres` for details.
inner_kwargs : kwargs
    Keyword parameters for the "inner" Krylov solver
    (defined with `method`). Parameter names must start with
    the `inner_` prefix which will be stripped before passing on
    the inner method. See, e.g., `scipy.sparse.linalg.gmres` for details.
%(params_extra)s

See Also
--------
root : Interface to root finding algorithms for multivariate
       functions. See ``method='krylov'`` in particular.
scipy.sparse.linalg.gmres
scipy.sparse.linalg.lgmres

Notes
-----
This function implements a Newton-Krylov solver. The basic idea is
to compute the inverse of the Jacobian with an iterative Krylov
method. These methods require only evaluating the Jacobian-vector
products, which are conveniently approximated by a finite difference:

.. math:: J v \approx (f(x + \omega*v/|v|) - f(x)) / \omega

Due to the use of iterative matrix inverses, these methods can
deal with large nonlinear problems.

SciPy's `scipy.sparse.linalg` module offers a selection of Krylov
solvers to choose from. The default here is `lgmres`, which is a
variant of restarted GMRES iteration that reuses some of the
information obtained in the previous Newton steps to invert
Jacobians in subsequent steps.

For a review on Newton-Krylov methods, see for example [1]_,
and for the LGMRES sparse inverse method, see [2]_.

References
----------
.. [1] C. T. Kelley, Solving Nonlinear Equations with Newton's Method,
       SIAM, pp.57-83, 2003.
       :doi:`10.1137/1.9780898718898.ch3`
.. [2] D.A. Knoll and D.E. Keyes, J. Comp. Phys. 193, 357 (2004).
       :doi:`10.1016/j.jcp.2003.08.010`
.. [3] A.H. Baker and E.R. Jessup and T. Manteuffel,
       SIAM J. Matrix Anal. Appl. 26, 962 (2005).
       :doi:`10.1137/S0895479803422014`

Examples
--------
The following functions define a system of nonlinear equations

>>> def fun(x):
...     return [x[0] + 0.5 * x[1] - 1.0,
...             0.5 * (x[1] - x[0]) ** 2]

A solution can be obtained as follows.

>>> from scipy import optimize
>>> sol = optimize.newton_krylov(fun, [0, 0])
>>> sol
array([0.66731771, 0.66536458])

Nc           	     óª  € W@n         Wn        \        \        P                  P
                  P                  \        P                  P
                  P                  \        P                  P
                  P                  \        P                  P
                  P                  \        P                  P
                  P                  \        P                  P
                  P                  R 7      P                  W"4      V n        \        W0P                   R7      V n        V P                  \        P                  P
                  P                  J d<   W0P                  R&   ^V P                  R&   V P                  P                  R^ 4       EMVV P                  \        P                  P
                  P                   \        P                  P
                  P                  \        P                  P
                  P                  39   d   V P                  P                  R^ 4       M¿V P                  \        P                  P
                  P                  J dŽ   WPP                  R&   ^V P                  R&   V P                  P                  R. 4       V P                  P                  RR4       V P                  P                  R	R
4       V P                  P                  R^ 4       \#        V P                  4      P$                   Uu. uF  pVR9  g   K  VNK  	  ppVP'                  4        F§  w  ršV	P)                  R4      '       g   \+        RV	 24      hV	R,          V9  d[   \-        V	R,          V^R7      pV'       d   RV^ ,           R2pMRp\.        P0                  ! RV	 RV R2V,           ^\2        R7       K’  W P                  V	R,          &   K©  	  R# u upi ))ÚbicgstabÚgmresÚlgmresÚcgsÚminresÚtfqmr)rx   r­  rŽ  rx   ÚatolÚouter_kÚouter_vÚprepend_outer_vTÚstore_outer_AvFÚinner_zUnknown parameter :é   NN)r†   z Did you mean 'z'?Ú zOption 'z#' is invalid for the inner method: zO. It will be ignored.Please check inner method documentation for valid options.)re  ÚcategoryN)r«   ÚargsÚkwargs)Úpreconditionerr›   r  r  r  r  r	  r
  r  r  r  r  ÚgetÚmethodÚ	method_kwÚ
setdefaultÚgcrotmkr   Ú
parametersrÄ   Ú
startswithrk   r   rf  rg  ÚUserWarning)r«   r›   r  Úinner_maxiterÚinner_Mr  rÇ   r�  Úvalid_inner_paramsÚkeyrÊ   Úinner_param_suggestionsÚsuggestion_msgs   &&&&&&,      r)   r¬   ÚKrylovJacobian.__init__¼  só  € à%ÔØŒ
ô Ü—\‘\×(Ñ(×1Ñ1Ü—,‘,×%Ñ%×+Ñ+Ü—<‘<×&Ñ&×-Ñ-Ü—‘×#Ñ#×'Ñ'Ü—<‘<×&Ñ&×-Ñ-Ü—,‘,×%Ñ%×+Ñ+ô÷ ‰c�&Ó!ð 	Œô  m×7JÑ7JÔKˆŒà�;‰;œ%Ÿ,™,×-Ñ-×3Ñ3Ó3à(5�N‰N˜9Ñ%Ø()ˆD�N‰N˜9Ñ%Ø�N‰N×%Ñ% f¨aÖ0Ø�[‰[œUŸ\™\×0Ñ0×8Ñ8Ü"Ÿ\™\×0Ñ0×9Ñ9Ü"Ÿ\™\×0Ñ0×4Ñ4ð6ô 6ð �N‰N×%Ñ% f¨aÕ0Ø�[‰[œEŸL™L×/Ñ/×6Ñ6Ó6Ø(/�N‰N˜9Ñ%à()ˆD�N‰N˜9Ñ%à�N‰N×%Ñ% i°Ô4Ø�N‰N×%Ñ%Ð&7¸Ô>ð �N‰N×%Ñ%Ð&6¸Ô>Ø�N‰N×%Ñ% f¨aÔ0ô ! §¡Ó-×8Ò8ó
Ù8�!ØÐ2Ñ2÷ ˆAÑ8ð 	ð 
ð
 Ÿ(™(ž*‰JˆCØ—>‘> (×+Ò+Ü Ð#5°c°UÐ!;Ó<Ð<Ø�2�wÐ0Ô0ä*;¸CÀ½GØ<NØ>?ô+AÐ'÷ +Ø(7Ø)@ÀÕ)CÐ(DÀBð'H‘Nð &(�Nô —’Ø˜s˜eÐ#FÀvÀhð OQð Qð %õ%ð  !Ü(õ	ñ Ø&+�N‰N˜3˜r�7Ó#ó7 %ùò
s   Ë=	OÌOc                óø   € \        V P                  4      P                  4       p\        V P                  4      P                  4       pV P                  \        ^V4      ,          \        ^V4      ,          V n        R# )r˜   N)r™   r>   r.   r)  r›   Úomega)r«   ÚmxÚmfs   &  r)   Ú_update_diff_stepÚ KrylovJacobian._update_diff_step	  sO   € Ü�—‘‹\×ÑÓˆÜ�—‘‹\×ÑÓˆØ—Z‘Z¤# a¨£*Õ,¬s°1°b«zÕ9ˆŽ
r(   c                ó¸  € \        V4      pV^ 8X  d
   ^ V,          # V P                  V,          pV P                  V P                  W1,          ,           4      V P                  ,
          V,          p\
        P                  ! \
        P                  ! V4      4      '       g<   \
        P                  ! \
        P                  ! V4      4      '       d   \        R4      hV# )r   z$Function returned non-finite results)	r   r+  rX   r>   r)  r,   rC   rB   rk   )r«   rF   ÚnvÚscr™  s   &&   r)   r¿   ÚKrylovJacobian.matvec  sŒ   € Ü�!‹WˆØ�Œ7Ø�Q•3ˆJØ�Z‰Z˜"�_ˆØ�Y‰Y�t—w‘w ¥•~Ó&¨¯©Õ0°BÕ6ˆÜ�vŠv”b—k’k !“n×%Ò%¬"¯&ª&´·²¸Q³×*@Ò*@ÜÐCÓDÐDØˆr(   c                óØ   € R V P                   9   d-   V P                  ! V P                  V3/ V P                   B w  r4V# V P                  ! V P                  V3R V/V P                   B w  r4V# )Úrtol)r  r  Úop)r«   Úrhsr[   ÚsolrŠ   s   &&&  r)   r   ÚKrylovJacobian.solve  s_   € Ø�T—^‘^Ô#ØŸš D§G¡G¨SÑC°D·N±NÑC‰IˆCð ˆ
ð Ÿš D§G¡G¨SÑM°sÐM¸d¿n¹nÑM‰IˆCØˆ
r(   c                óÐ   € Wn         W n        V P                  4        V P                  e<   \	        V P                  R4      '       d   V P                  P                  W4       R # R # R # )Nrp   )r>   r)  r.  r  rÆ   rp   )r«   r0   r°   s   &&&r)   rp   ÚKrylovJacobian.update  sW   € ØŒØŒØ×ÑÔ ð ×ÑÒ*Ü�t×*Ñ*¨H×5Ò5Ø×#Ñ#×*Ñ*¨1Ö0ñ 6ñ +r(   c                óâ  € \         P                  WW#4       Wn        W n        \        P
                  P                  P                  V 4      V n        V P                  f7   \        P                  ! VP                  4      P                  R,          V n	        V P                  4        V P                  e=   \!        V P                  R4      '       d   V P                  P                  WV4       R # R # R # )Nrh   r&  )r¹   rh   r>   r)  r  r  r  Úaslinearoperatorr6  r›   r,   r¨   r4   r©   r.  r  rÆ   )r«   r0   r°   rX   s   &&&&r)   rh   ÚKrylovJacobian.setup)  s¬   € Ü�‰�t Ô(ØŒØŒÜ—,‘,×%Ñ%×6Ñ6°tÓ<ˆŒà�:‰:ÒÜŸš !§'¡'Ó*×.Ñ.°4Õ8ˆDŒJà×ÑÔ ð ×ÑÒ*Ü�t×*Ñ*¨G×4Ò4Ø×#Ñ#×)Ñ)¨!°Ö5ñ 5ñ +r(   )r)  r  r  r+  r6  r  r›   r>   )Nr  é   Né
   rŽ   )r"   r#   r$   r%   r&   r¬   r.  r¿   r   rp   rh   r'   rµ   r¶   s   @r)   r   r   V  s1   ø‡ € ñcôJK,òZ:ò
ôò1÷6ð 6r(   c           	     óŽ  € \        VP                  4      pVw  r4rVrxp	\        \        V\	        V4      ) R V4      4      p
RP                  V
 UUu. uF  w  r¼V RV: 2NK  	  upp4      pV'       d
   RV,           pRP                  V
 UUu. uF  w  r¼V RV 2NK  	  upp4      pV'       d
   VR,           pV'       d   \        RV 24      hRpV\        WVP                  VR7      ,          p/ pVP                  \        4       4       \        VV4       VV ,          pVP                  Vn        \        V4       V# u uppi u uppi )zï
Construct a solver wrapper with given name and Jacobian approx.

It inspects the keyword arguments of ``jac.__init__``, and allows to
use the same arguments in the wrapper function, in addition to the
keyword arguments of `nonlin_solve`

Nz, Ú=zUnexpected signature a™  
def %(name)s(F, xin, iter=None %(kw)s, verbose=False, maxiter=None,
             f_tol=None, f_rtol=None, x_tol=None, x_rtol=None,
             tol_norm=None, line_search='armijo', callback=None, **kw):
    jac = %(jac)s(%(kwkw)s **kw)
    return nonlin_solve(F, xin, jac, iter, verbose, maxiter,
                        f_tol, f_rtol, x_tol, x_rtol, tol_norm, line_search,
                        callback)
)rÉ   rÇ   ÚjacÚkwkw)Ú_getfullargspecr¬   Úlistr?  rH  Újoinrk   r  r"   rp   ÚglobalsÚexecr&   rM   )rÉ   rC  r   r  ÚvarargsÚvarkwÚdefaultsÚ
kwonlyargsÚ
kwdefaultsÚ_r  r�  rF   Úkw_strÚkwkw_strÚwrapperÚnsrX   s   &&                r)   Ú_nonlin_wrapperrT  >  s*  € ô   §¡Ó-€IØ@IÑ=€D�5 J¸AÜ”#�dœC ›M˜>˜?Ð+¨XÓ6Ó7€FØ�Y‰Y±Ô8±©¨˜1˜#˜Q˜q™e›±Ò8Ó9€FßØ˜•ˆØ�y‰y±Ô8±©¨˜Q˜C˜q  ›*±Ò8Ó9€HßØ˜d•?ˆßÜÐ0°°Ð<Ó=Ð=ð€Gð œ $°s·|±|Ø"*ô,õ ,€Gà	€BØ‡I�IŒg‹iÔÜˆ�"ÔØˆd�8€DØ—;‘;€D„LÜˆT„NØ€Kùó; 9ùó 9s   ÁD;
ÂE
)r   r   r   r   r   r   r   r   r   r   r   )r  NFNNNNNNrZ   NFT)rZ   g:Œ0âŽyE>rŸ   )Br  rq   rf  Únumpyr,   r   r   r   Úscipy.linalgr   r   r   r	   r
   r   Úscipy.sparse.linalgr  Úscipy.sparser   Úscipy._lib._utilr   r   r   rE  Ú_linesearchr   r   r   Údifflibr   Útypesr   Ú__all__Ú	Exceptionr   r1   r8   r@   rG   r  ÚstriprK   rM   r‹   ro   re   r¹   r   rg   r#  r5  r   r  r  r  r  r   r   rT  r   r   r   r   r   r   r   r!   r(   r)   Ú<module>r`     sß  ðó Û 
Û ã ß $Ñ $ç ?× ?Û Û Ý 'ß >Ý Fß CÝ Ý %Ý òJ€ô	�Iô 	ò òòòñ Ù"ð $ó 	÷ 
‰‹Ù"ð ($ó (	÷P 
‰‹ôa1€
òh/ô
O"ñd 	ˆÔ ô*÷Z9<ñ 9<÷@Hñ H÷V(#ñ (#òVY?ô@�Xô ÷:Lñ Lñ^  1ð 2ó  	÷* 
‰‹ð+ ÐÑ ô0m�>ô mô`9�Lô 9ô@Uˆ~ô UôxA1�.ô A1ôH+�>ô +ô\8<�^ô 8<ô~a6�Xô a6òP)ñX ˜: |Ó4€Ù˜: }Ó5€Ù˜: xÓ0€Ù˜~¨|Ó<€Ù˜m¨[Ó9€Ù Ð!1°>ÓB€Ù °Ó@‚r(   