Ë
    /æjn*  ã            	       ó`   — d dl mZmZmZmZ d dlmZ d dlmZ ddl	m
Z
 dgZddd	dddd
d
dœd„Zy)é    )ÚinnerÚzerosÚinfÚfinfo)Únorm)Úsqrté   )Úmake_systemÚminresNgñhãˆµøä>g        F)ÚrtolÚshiftÚmaxiterÚMÚcallbackÚshowÚcheckc                ó¾
  — t        | |||«      \  } }}
}| j                  }|j                  }d}d}| j                  d   }|€d|z  }g d¢}|rDt        |dz   «       t        |d|d›d	|d
›�z   «       t        |d|d›d|d›�z   «       t        «        d}d}d}d}d}d}|
j                  }t        |«      j                  }|€|j                  «       }n|| |
z  z
  } ||«      }t        ||«      }|dk  rt        d«      ‚|dk(  r|
dfS t        |«      }|dk(  r|}
|
dfS t        |«      }|	rš ||«      } ||«      }t        ||«      }t        ||«      } t        || z
  «      }!||z   |dz  z  }"|!|"kD  rt        d«      ‚ ||«      }t        ||«      }t        ||«      } t        || z
  «      }!||z   |dz  z  }"|!|"kD  rt        d«      ‚d}#|}$d}%d}&|}'|}(|})d}*d}+d},t        |«      j                  }-d}.d}/t        ||¬«      }t        ||¬«      }0|}|rt        «        t        «        t        d«       ||k  �r¨|dz  }d|$z  }||z  }1 ||1«      }|||1z  z
  }|dk\  r||$|#z  |z  z
  }t        |1|«      }2||2|$z  |z  z
  }|}|} ||«      }|$}#t        ||«      }$|$dk  rt        d«      ‚t        |$«      }$|+|2dz  |#dz  z   |$dz  z   z  }+|dk(  r|$|z  d|z  k  rd}|&}3|.|%z  |/|2z  z   }4|/|%z  |.|2z  z
  }5|/|$z  }&|. |$z  }%t        |5|%g«      }6|(|6z  }7t        |5|$g«      }8t        |8|«      }8|5|8z  }.|$|8z  }/|.|(z  }9|/|(z  }(d|8z  }:|0};|}0|1|3|;z  z
  |4|0z  z
  |:z  }|
|9|z  z   }
t        |,|8«      },t        |-|8«      }-|)|8z  }!|*|4|!z  z
  })|& |!z  }*t        |+«      }t        |
«      }||z  }"||z  |z  }<||z  |z  }=|5}>|>dk(  r|"}>|(}'|'}|dk(  s|dk(  rt         }?n|||z  z  }?|dk(  rt         }@n|6|z  }@|,|-z  }|dk(  r>d|?z   }Ad@z   }B|Bdk  rd}Adk  rd}||k\  rd}|d|z  k\  rd}|<|k\  rd}@|k  rd}|?|k  rd}d}C|dk  rd}C|dk  rd}C||dz
  k\  rd}C|dz  dk(  rd}C|'d|<z  k  rd}C|'d|=z  k  rd}C|d |z  k  rd}C|dk7  rd}C|rLCrJ|d!›d"|
d   d#›d"|?d$›�}Dd"@d$›�}Ed"|d%›d"|d%›d"|5|z  d%›�}Ft        |D|Ez   |Fz   «       |dz  dk(  r
t        «        |� ||
«       |dk7  rn||k  r�Œ¨|rrt        «        t        |d&|d›d'|d(›�z   «       t        |d)|d*›d+|d*›�z   «       t        |d,|d*›d-|d*›�z   «       t        |d.7d*›�z   «       t        |||dz      z   «       |dk(  r|}G|
|GfS d}G|
GfS )/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                                                                           úe/root/repos/pocs/video-evals/.venv/lib/python3.12/site-packages/scipy/sparse/linalg/_isolve/minres.pyr   r   
   sd  € ôd ˜Q  2 qÓ)�J€A€qˆ!ˆQà�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   