ó
    Eñin*  ã            	       ód   • S SK JrJrJrJr  S SKJr  S SKJr  SSK	J
r
  S/rSSS	SSSS
S
S.S jjrg)é    )ÚinnerÚzerosÚinfÚfinfo)Únorm)Úsqrté   )Úmake_systemÚminresNgñhãˆµøä>g        F)ÚrtolÚshiftÚmaxiterÚMÚcallbackÚshowÚcheckc                ó0  • [        XX!5      u  pp¡U R                  nUR                  nSnSnU R                  S   nUc  SU-  n/ SQnU(       aD  [        US-   5        [        USUS S	US
 3-   5        [        USUS SUS 3-   5        [        5         SnSnSnSnSnSnU
R                  n[        U5      R                  nUc  UR                  5       nOXU
-  -
  nU" U5      n[        UU5      nUS:  a  [        S5      eUS:X  a  U
S4$ [        U5      nUS:X  a  Un
U
S4$ [        U5      nU	(       aœ  U" U5      nU" U5      n[        UU5      n[        UU5      n [        UU -
  5      n!UU-   US-  -  n"U!U":”  a  [        S5      eU" U5      n[        UU5      n[        UU5      n [        UU -
  5      n!UU-   US-  -  n"U!U":”  a  [        S5      eSn#Un$Sn%Sn&Un'Un(Un)Sn*Sn+Sn,[        U5      R                  n-Sn.Sn/[        UUS9n[        UUS9n0UnU(       a  [        5         [        5         [        S5        UU:  GaÏ  US-  nSU$-  nUU-  n1U" U15      nUUU1-  -
  nUS:¼  a  UU$U#-  U-  -
  n[        U1U5      n2UU2U$-  U-  -
  nUnUnU" U5      nU$n#[        UU5      n$U$S:  a  [        S5      e[        U$5      n$U+U2S-  U#S-  -   U$S-  -   -  n+US:X  a  U$U-  SU-  ::  a  SnU&n3U.U%-  U/U2-  -   n4U/U%-  U.U2-  -
  n5U/U$-  n&U.* U$-  n%[        U5U%/5      n6U(U6-  n7[        U5U$/5      n8[        U8U5      n8U5U8-  n.U$U8-  n/U.U(-  n9U/U(-  n(SU8-  n:U0n;Un0U1U3U;-  -
  U4U0-  -
  U:-  nU
U9U-  -   n
[        U,U85      n,[        U-U85      n-U)U8-  n!U*U4U!-  -
  n)U&* U!-  n*[        U+5      n[        U
5      nUU-  n"UU-  U-  n<UU-  U-  n=U5n>U>S:X  a  U"n>U(n'U'nUS:X  d  US:X  a  [         n?OUUU-  -  n?US:X  a  [         n@OU6U-  n@U,U--  nUS:X  aE  SU?-   nASW@-   nBUBS::  a  SnWAS::  a  SnUU:¼  a  SnUSU-  :¼  a  SnU<U:¼  a  SnW@U::  a  SnU?U::  a  SnSnCUS::  a  SnCUS::  a  SnCUUS-
  :¼  a  SnCUS-  S:X  a  SnCU'SU<-  ::  a  SnCU'SU=-  ::  a  SnCUS U-  ::  a  SnCUS:w  a  SnCU(       aR  WC(       aK  US! S"U
S   S# S"U?S$ 3nDS"W@S$ 3nES"US% S"US% S"U5U-  S% 3nF[        UDUE-   UF-   5        US-  S:X  a
  [        5         Ub  U" U
5        US:w  a  O	UU:  a  GMÏ  U(       ar  [        5         [        US&US S'US( 3-   5        [        US)US* S+US* 3-   5        [        US,US* S-US* 3-   5        [        US.W7S* 3-   5        [        UUUS-      -   5        US:X  a  UnGU
UG4$ SnGU
WG4$ )/aÏ
  
Solve ``Ax = b`` with the MINimum RESidual method, for a symmetric `A`.

MINRES minimizes norm(Ax - b) for a real symmetric matrix A.  Unlike
the Conjugate Gradient method, A can be indefinite or singular.

If shift != 0 then the method solves (A - shift*I)x = b

Parameters
----------
A : {sparse array, ndarray, LinearOperator}
    The real symmetric N-by-N matrix of the linear system
    Alternatively, ``A`` can be a linear operator which can
    produce ``Ax`` using, e.g.,
    ``scipy.sparse.linalg.LinearOperator``.
b : ndarray
    Right hand side of the linear system. Has shape (N,) or (N,1).

Returns
-------
x : ndarray
    The converged solution.
info : integer
    Provides convergence information:
        0  : successful exit
        >0 : convergence to tolerance not achieved, number of iterations
        <0 : illegal input or breakdown

Other Parameters
----------------
x0 : ndarray
    Starting guess for the solution.
shift : float
    Value to apply to the system ``(A - shift * I)x = b``. Default is 0.
rtol : float
    Tolerance to achieve. The algorithm terminates when the relative
    residual is below ``rtol``.
maxiter : integer
    Maximum number of iterations.  Iteration will stop after maxiter
    steps even if the specified tolerance has not been achieved.
M : {sparse array, ndarray, LinearOperator}
    Preconditioner for A.  The preconditioner should approximate the
    inverse of A.  Effective preconditioning dramatically improves the
    rate of convergence, which implies that fewer iterations are needed
    to reach a given error tolerance.
callback : function
    User-supplied function to call after each iteration.  It is called
    as callback(xk), where xk is the current solution vector.
show : bool
    If ``True``, print out a summary and metrics related to the solution
    during iterations. Default is ``False``.
check : bool
    If ``True``, run additional input validation to check that `A` and
    `M` (if specified) are symmetric. Default is ``False``.

Examples
--------
>>> import numpy as np
>>> from scipy.sparse import csc_array
>>> from scipy.sparse.linalg import minres
>>> A = csc_array([[3, 2, 0], [1, -1, 0], [0, 5, 1]], dtype=float)
>>> A = A + A.T
>>> b = np.array([2, 4, -1], dtype=float)
>>> x, exitCode = minres(A, b)
>>> print(exitCode)            # 0 indicates successful convergence
0
>>> np.allclose(A.dot(x), b)
True

References
----------
Solution of sparse indefinite systems of linear equations,
    C. C. Paige and M. A. Saunders (1975),
    SIAM J. Numer. Anal. 12(4), pp. 617-629.
    https://web.stanford.edu/group/SOL/software/minres/

This file is a translation of the following MATLAB implementation:
    https://web.stanford.edu/group/SOL/software/minres/minres-matlab.zip

zEnter minres.   zExit  minres.   r   é   )z3 beta2 = 0.  If M = I, b and x are eigenvectors    z/ beta1 = 0.  The exact solution is x0          z3 A solution to Ax = b was found, given rtol        z3 A least-squares solution was found, given rtol    z3 Reasonable accuracy achieved, given eps           z3 x has converged to an eigenvector                 z3 acond has exceeded 0.1/eps                        z3 The iteration limit was reached                   z3 A  does not define a symmetric matrix             z3 M  does not define a symmetric matrix             z3 M  does not define a pos-def preconditioner       zSolution of symmetric Ax = bz
n      =  Ú3gz     shift  =  z23.14ez
itnlim =  z     rtol   =  z11.2ezindefinite preconditionergUUUUUUÕ?znon-symmetric matrixznon-symmetric preconditioneréÿÿÿÿ)ÚdtypezD   Itn     x(1)     Compatible    LS       norm(A)  cond(A) gbar/|A|r	   g      ð?é   é
   é   gš™™™™™¹?é   é   Fé(   Tg{®Gáz„?Ú6gÚ z12.5ez10.3ez8.1ez istop   =  z               itn   =Ú5gz Anorm   =  z12.4ez      Acond =  z rnorm   =  z      ynorm =  z Arnorm  =  )r
   ÚmatvecÚshapeÚprintr   r   ÚepsÚcopyr   Ú
ValueErrorr   r   ÚabsÚmaxr   Úminr   )HÚAÚbÚx0r   r   r   r   r   r   r   Úxr!   ÚpsolveÚfirstÚlastÚnÚmsgÚistopÚitnÚAnormÚAcondÚrnormÚynormÚxtyper$   Úr1ÚyÚbeta1ÚbnormÚwÚr2ÚsÚtÚzÚepsaÚoldbÚbetaÚdbarÚepslnÚqrnormÚphibarÚrhs1Úrhs2Útnorm2ÚgmaxÚgminÚcsÚsnÚw2ÚvÚalfaÚoldepsÚdeltaÚgbarÚrootÚArnormÚgammaÚphiÚdenomÚw1ÚepsxÚepsrÚdiagÚtest1Útest2Út1Út2ÚprntÚstr1Ústr2Ústr3ÚinfosH                                                                           Ú_/home/mande/repo/quber/.venv/lib/python3.13/site-packages/scipy/sparse/linalg/_isolve/minres.pyr   r   
   sZ  € ôd ˜Q 2Ó)�J€Aˆ!à�X‰X€FØ�X‰X€Fà€EØ€Dà	�‰�‰
€Aà�Ø�a‘%ˆò
C€Cö ÜˆeÐ4Ñ4Ô5Üˆe˜
 1 R &¨¸¸f°~ÐFÑFÔGÜˆe˜
 7¨2 ,¨o¸dÀ5¸\ÐJÑJÔKÜŒà€EØ
€CØ€EØ€EØ€EØ€Eà�G‰G€Eä
�‹,×
Ñ
€Cð 
�zØ�V‰V‹X‰à�1‘‰WˆÙˆr‹
€Aä�"�a‹L€EàˆqƒyÜÐ4Ó5Ð5Ø	�!‹Ø�1ˆvˆä�‹G€EØ�ƒzØˆØ�1ˆvˆä�‹K€Eæñ �1‹IˆÙ�A‹YˆÜ�!�A‹JˆÜ�!�B‹KˆÜ��A‘‹JˆØ�C‘˜3 ™>Ñ)ˆØˆt‹8ÜÐ3Ó4Ð4ñ �A‹YˆÜ�!�A‹JˆÜ�"�R‹LˆÜ��A‘‹JˆØ�C‘˜3 ™>Ñ)ˆØˆt‹8ÜÐ;Ó<Ð<ð €DØ€DØ€DØ€EØ€FØ€FØ€DØ€DØ€FØ€DÜ�‹<×Ñ€DØ	€BØ	
€BÜˆa�uÑ€AÜ	ˆq˜Ñ	€BØ	€BæÜŒÜŒÜÐTÔUà
�Œ-Øˆq‰ˆà�‰HˆØˆa‰Cˆá�1‹IˆØ�˜‘	‰Mˆà�!‹8Ø�T˜$‘Y ‘NÑ"ˆAä�Q�q‹zˆØ��d‘˜B‘ÑˆØˆØˆÙ�2‹JˆØˆÜ�R˜‹{ˆØ�!‹8ÜÐ3Ó4Ð4Ü�D‹zˆØ�$˜‘'˜D !™GÑ# d¨A¡gÑ-Ñ-ˆà�!‹8Ø�E‰z˜R ™VÓ#Ø�ð ˆØ�T‘	˜B ™IÑ%ˆØ�D‰y˜2 ™9Ñ$ˆØ�T‘	ˆØˆt�d‰{ˆÜ�T˜4�LÓ!ˆØ˜$‘ˆô �d˜D�\Ó"ˆÜ�E˜3“ˆØ�E‰\ˆØ�E‰\ˆØ�6‰kˆØ�f‘ˆð �E‘	ˆØˆØˆØ�˜‘‰]˜U 2™XÑ%¨Ñ.ˆØ��A‘‰Iˆô �4˜ÓˆÜ�4˜ÓˆØ�5‰LˆØ�e˜A‘g‰~ˆØˆw�q‰yˆô �V“ˆÜ�Q“ˆØ�s‰{ˆØ�u‰}˜sÑ"ˆØ�u‰}˜tÑ#ˆØˆà�1‹9ØˆDàˆØˆØ�A‹:˜ !›Ü‰Eà˜U 5™[Ñ)ˆEØ�A‹:Ü‰Eà˜5‘LˆEð �T‘	ˆð
 �A‹:Ø�U‘ˆBØ�U‘ˆBØ�Q‹wØ�Ø�Q‹wØ�à�g‹~Ø�Ø˜˜C™ÓØ�Ø�u‹}Ø�ð ˜‹}Ø�Ø˜‹}Ø�ð ˆØ�‹7ØˆDØ�"‹9ØˆDØ�'˜"‘*ÓØˆDØ�‰8�q‹=ØˆDØ�R˜‘WÓØˆDØ�R˜‘WÓØˆDØ�D˜‘HÓØˆDØ�A‹:ØˆDæ–DØ˜"�X˜Q˜q ™t E˜l¨!¨E°%¨=Ð9ˆDØ�u˜U�mÐ$ˆDØ�u˜T�l ! E¨$ <¨q°°e±¸DÐ0AÐBˆDä�$˜‘+ Ñ$Ô%à�R‰x˜1‹}Ü”àÑÙ�QŒKà�A‹:Øðu �Ž-öx ÜŒÜˆd�| E¨" :Ð-CÀCÈÀ8ÐLÑLÔMÜˆd�| E¨% =°ÀÀe¸}ÐMÑMÔNÜˆd�| E¨% =°ÀÀe¸}ÐMÑMÔNÜˆd�| F¨5 >Ð2Ñ2Ô3Üˆd�S˜˜q™‘\Ñ!Ô"à�ƒzØˆð ˆdˆ8€Oð ˆàˆdˆ8€Oó    )N)Únumpyr   r   r   r   Únumpy.linalgr   Úmathr   Úutilsr
   Ú__all__r   © rj   ri   Ú<module>rq      s6   ðß *Ó *Ý Ý å àˆ*€ðj $¨c¸4Ø˜D u°E÷jrj   