403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/scipy/sparse/linalg/_isolve/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/scipy/sparse/linalg/_isolve/__pycache__/minres.cpython-311.pyc
�

d�c�,��x�ddlmZmZmZmZddlmZddlmZddl	m
Z
dgZ		dd�Ze
dkr�dd
lmZddlmZdZgZd�Zeededze���gdgeed���Zedededze���zgdgeed���Zeje_eejd��Zeeedde���ZdSdS)�)�inner�zeros�inf�finfo)�norm)�sqrt�)�make_system�minresN���h㈵��>Fc
�b�t||||��\}}}
}}|j}|j}
d}d}|jd}|�d|z}gd�}|rNt|dz��t|d||fzz��t|d	||fzz��t��d}d}d}d}d}d}|
j}t|��j}|�|���}n|||
zz
}|
|��}t||��}|dkrtd
���|dkr
||
��dfSt|��}|dkr|}
||
��dfSt|��}|	r�||��}||��}t||��} t||��}!t| |!z
��}"| |z|dzz}#|"|#krtd���|
|��}t||��} t||��}!t| |!z
��}"| |z|dzz}#|"|#krtd
���d}$|}%d}&d}'|}(|})|}*d}+d},d}-t|��j
}.d}/d}0t||���}t||���}1|}|r+t��t��td��||k�r�|dz
}d|%z} | |z}2||2��}|||2zz
}|dkr||%|$z|zz
}t|2|��}3||3|%z|zz
}|}|}|
|��}|%}$t||��}%|%dkrtd���t|%��}%|,|3dz|$dzz|%dzzz
},|dkr|%|zd|zkrd}|'}4|/|&z|0|3zz}5|0|&z|/|3zz
}6|0|%z}'|/|%z}&t|6|&g��}7|)|7z}8t|6|%g��}9t|9|��}9|6|9z}/|%|9z}0|/|)z}:|0|)z})d|9z};|1}<|}1|2|4|<zz
|5|1zz
|;z}|
|:|zz}
t|-|9��}-t|.|9��}.|*|9z}"|+|5|"zz
}*|'|"z}+t|,��}t|
��}||z}#||z|z}=||z|z}>|6}?|?dkr|#}?|)}(|(}|dks|dkrt }@n|||zz}@|dkrt }An|7|z}A|-|.z}|dkrEd|@z}Bd|Az}C|Cdkrd}|Bdkrd}||krd}|d|zkrd}|=|krd}|A|krd}|@|krd}d}D|dkrd}D|dkrd}D||dz
krd}D|dzdkrd}D|(d|=zkrd}D|(d|>zkrd}D|d|zkrd}D|dkrd}D|rM|DrKd||
d|@fz}Ed|Afz}Fd|||6|zfz}Gt|E|Fz|Gz��|dzdkrt��|�||
��|dkrn||k���|r�t��t|d ||fzz��t|d!||fzz��t|d"||fzz��t|d#|8fzz��t|||dzz��|dkr|}Hnd}H||
��|HfS)$a�
    Use MINimum RESidual iteration to solve Ax=b

    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 matrix, 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.
    tol : float
        Tolerance to achieve. The algorithm terminates when the relative
        residual is below `tol`.
    maxiter : integer
        Maximum number of iterations.  Iteration will stop after maxiter
        steps even if the specified tolerance has not been achieved.
    M : {sparse matrix, 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_matrix
    >>> from scipy.sparse.linalg import minres
    >>> A = csc_matrix([[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

    zEnter minres.   zExit  minres.   rN�)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       zSolution of symmetric Ax = bz#n      =  %3g     shift  =  %23.14ez"itnlim =  %3g     rtol   =  %11.2ezindefinite preconditionergUUUUUU�?znon-symmetric matrixznon-symmetric preconditioner�����dtypezD   Itn     x(1)     Compatible    LS       norm(A)  cond(A) gbar/|A|r	��?��
�g�������?��F�(Tg{�G�z�?z%6g %12.5e %10.3ez %10.3ez %8.1e %8.1e %8.1ez( istop   =  %3g               itn   =%5gz' Anorm   =  %12.4e      Acond =  %12.4ez' rnorm   =  %12.4e      ynorm =  %12.4ez Arnorm  =  %12.4e)r
�matvec�shape�printrr�eps�copyr�
ValueErrorrr�abs�maxr�minr)I�A�b�x0�shift�tol�maxiter�M�callback�show�check�x�postprocessr�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�infosI                                                                         �D/usr/lib/python3/dist-packages/scipy/sparse/linalg/_isolve/minres.pyrr
s`��d*�!�Q��A�6�6��A�q�!�Q��
�X�F�
�X�F��E��D�	���
�A����a�%��
C�
C�
C�C���
�e�4�4�5�5�5�
�e�;�q��i�G�G�H�H�H�
�e�:�g�c�]�J�J�K�K�K�
����
�E�
�C�
�E�
�E�
�E�
�E�
�G�E�
��,�,�
�C�
�z�
�V�V�X�X���
��1��W����r�
�
�A��"�a�L�L�E��q�y�y��4�5�5�5�	�!�����A����"�"���G�G�E���z�z�
����A����"�"���K�K�E��=�
�F�1�I�I��
�V�A�Y�Y���!�A�J�J���!�B�K�K����A��J�J���C��3��>�)���t�8�8��3�4�4�4��V�A�Y�Y���!�A�J�J���"�R�L�L����A��J�J���C��3��>�)���t�8�8��;�<�<�<�
�D��D��D�
�E�
�F�
�F��D��D�
�F��D���<�<��D�	�B�	
�B�
�a�u����A�	�q��	�	�	�B�	�B��V�
����
����
�T�U�U�U�

��-�-��q�����H��
�a�C���F�1�I�I��
���	�M���!�8�8��T�$�Y��N�"�A��Q�q�z�z��
��d��B����
��
���F�2�J�J�����R��{�{���!�8�8��3�4�4�4��D�z�z���$��'�D�!�G�#�d�A�g�-�-���!�8�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�}�s�"�����1�9�9��D������A�:�:��!����E�E��U�5�[�)�E��A�:�:��E�E��5�L�E��T�	��
�A�:�:��U��B��U��B��Q�w�w����Q�w�w����g�~�~�����C�������u�}�}�����|�|�����|�|�������7�7��D��"�9�9��D��'�"�*����D���8�q�=�=��D��R��W����D��R��W����D��D��H����D��A�:�:��D��	�D�	�&�#�q��t�U�);�;�D���x�'�D�'�5�%��e��*D�D�D��$��+��$�%�%�%��R�x�1�}�}��������H�Q�K�K�K��A�:�:��u��-�-�x�#�
����
�d�?�5��+�M�M�N�N�N�
�d�>�%���N�N�O�O�O�
�d�>�%���N�N�O�O�O�
�d�)�V�I�5�5�6�6�6�
�d�S��q��\�!�"�"�"���z�z�������K��N�N�4� � ��__main__)�arange)�spdiagsrc�t�t�ttt|zz
����dS)N)�	residuals�appendrr$r#)r-s rj�cbrrs*������a�!�A�#�g���'�'�'�'�'rkr�csr)�formatrg�-���q=)r'r(r*)Nrr
NNNFF)�numpyrrrr�numpy.linalgr�mathr�utilsr
�__all__r�__name__rm�scipy.sparsernr2rprr�floatr#r)rr/rr$r-�rkrj�<module>r~s���*�*�*�*�*�*�*�*�*�*�*�*��������������������*��8<�49�j!�j!�j!�j!�Z�z���������$�$�$�$�$�$�
�A��I�(�(�(�	�����!�A�#�E�*�*�*�+�a�S�!�Q�u�E�E�E�A����V�V�A�a��c��.�.�.�.�/�!��a��5�I�I�I�A��x�A�H�
��a�g�a�j���A���q��u�T�2�6�6�6�A�A�A�!�rk

Youez - 2016 - github.com/yon3zu
LinuXploit