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__/tfqmr.cpython-311.pyc
�

d�ca��,�ddlZddlmZdgZ		dd�ZdS)	�N�)�make_system�tfqmr��h㈵��>Fc	��|j}	tj|	tj��rt}	|�|	��}tj|jtj��r|�|	��}t
||||��\}}}
}}tj�|��dkr!|�	��}
||
��dfS|j
d}|�td|dz��}|�|�	��}
n||�|
��z
}
|
}|
�	��}|
}|�|�|
����}|}dx}x}}tj
|���|
��}|}tj|��}|}|dkr
||
��dfS|�||z}nt!|||z��}t#|��D�]�}|dzdk}|rItj
|���|��}|dkr||
��dfcS||z}|||zz
}|||zz}||dz|z|z|zz}tj�|��|z}tjdd	|dzzz��}|||zz}|dz|z}|�|��} |
|| zz
}
|�||
��|tj|d	z��z|kr6|r%t%d
�|d	z����||
��dfcS|sqtj
|���|��}||z}!||!|zz}|!|z|!dz|zz}|�|�|����}||z
}���|�|�|����}|}|}���|r%t%d�|d	z����||
��|fS)a�

    Use Transpose-Free Quasi-Minimal Residual iteration to solve ``Ax = b``.

    Parameters
    ----------
    A : {sparse matrix, ndarray, LinearOperator}
        The real or complex 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).
    x0 : {ndarray}
        Starting guess for the solution.
    tol, atol : float, optional
        Tolerances for convergence, ``norm(residual) <= max(tol*norm(b-Ax0), atol)``.
        The default for `tol` is 1.0e-5.
        The default for `atol` is ``tol * norm(b-Ax0)``.

        .. warning::

           The default value for `atol` will be changed in a future release.
           For future compatibility, specify `atol` explicitly.
    maxiter : int, optional
        Maximum number of iterations.  Iteration will stop after maxiter
        steps even if the specified tolerance has not been achieved.
        Default is ``min(10000, ndofs * 10)``, where ``ndofs = A.shape[0]``.
    M : {sparse matrix, ndarray, LinearOperator}
        Inverse of the preconditioner of A.  M should approximate the
        inverse of A and be easy to solve for (see Notes).  Effective
        preconditioning dramatically improves the rate of convergence,
        which implies that fewer iterations are needed to reach a given
        error tolerance.  By default, no preconditioner is used.
    callback : function, optional
        User-supplied function to call after each iteration.  It is called
        as `callback(xk)`, where `xk` is the current solution vector.
    show : bool, optional
        Specify ``show = True`` to show the convergence, ``show = False`` is
        to close the output of the convergence.
        Default is `False`.

    Returns
    -------
    x : ndarray
        The converged solution.
    info : int
        Provides convergence information:

            - 0  : successful exit
            - >0 : convergence to tolerance not achieved, number of iterations
            - <0 : illegal input or breakdown

    Notes
    -----
    The Transpose-Free QMR algorithm is derived from the CGS algorithm.
    However, unlike CGS, the convergence curves for the TFQMR method is
    smoothed by computing a quasi minimization of the residual norm. The
    implementation supports left preconditioner, and the "residual norm"
    to compute in convergence criterion is actually an upper bound on the
    actual residual norm ``||b - Axk||``.

    References
    ----------
    .. [1] R. W. Freund, A Transpose-Free Quasi-Minimal Residual Algorithm for
           Non-Hermitian Linear Systems, SIAM J. Sci. Comput., 14(2), 470-482,
           1993.
    .. [2] Y. Saad, Iterative Methods for Sparse Linear Systems, 2nd edition,
           SIAM, Philadelphia, 2003.
    .. [3] C. T. Kelley, Iterative Methods for Linear and Nonlinear Equations,
           number 16 in Frontiers in Applied Mathematics, SIAM, Philadelphia,
           1995.

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.sparse import csc_matrix
    >>> from scipy.sparse.linalg import tfqmr
    >>> A = csc_matrix([[3, 2, 0], [1, -1, 0], [0, 5, 1]], dtype=float)
    >>> b = np.array([2, 4, -1], dtype=float)
    >>> x, exitCode = tfqmr(A, b)
    >>> print(exitCode)            # 0 indicates successful convergence
    0
    >>> np.allclose(A.dot(x), b)
    True
    grNi'�
����g�?rz<TFQMR: Linear solve converged due to reach TOL iterations {}zBTFQMR: Linear solve not converged due to reach MAXIT iterations {})�dtype�np�
issubdtype�int64�float�astyper�linalg�norm�copy�shape�min�matvec�inner�	conjugate�sqrt�max�range�print�format)"�A�b�x0�tol�maxiter�M�callback�atol�showr�x�postprocess�ndofs�r�u�w�rstar�v�uhat�d�theta�eta�rho�rhoLast�r0norm�tau�iter�even�vtrstar�alpha�uNext�c�z�betas"                                  �C/usr/lib/python3/dist-packages/scipy/sparse/linalg/_isolve/tfqmr.pyrrs��r
�G�E�	�}�U�B�H�%�%����
�H�H�U�O�O��	�}�Q�W�b�h�'�'��
�H�H�U�O�O��)�!�Q��A�6�6��A�q�!�Q��
�y�~�~�a���B���
�F�F�H�H����A����"�"�
�G�A�J�E����e�U�R�Z�(�(��	�z�
�F�F�H�H���
�������O��	�A�	�����A�
�E�	������!�����A��D���A����
�(�5�?�?�$�$�a�
(�
(�C��G�
�W�S�\�\�F�
�C�
��{�{���A����"�"��|��V�|����4��v��&�&���g���)�)���a�x�1�}���	"��h�u���0�0�!�4�4�G��"�}�}�#��A����+�+�+�+��'�M�E����	�M�E�	�U�T�\���
����E�!�S�(�1�,�,���	���q�!�!�C�'���G�B�!�e�Q�h�,�'�(�(���u�q�y����!�t�u�n��
�H�H�Q�K�K��	�S�1�W������H�Q�K�K�K�����a���� �4�'�'��
6��&�&,�f�T�!�V�n�n�6�6�6��K��N�N�A�&�&�&�&��	��(�5�?�?�,�,�a�0�0�C���=�D��D�1�H��A��t��t�Q�w�!�m�+�A��8�8�A�H�H�Q�K�K�(�(�D�
��I�A�A��8�8�A�H�H�U�O�O�,�,�D��A��G�G��.�
��$�f�T�!�V�n�n�	.�	.�	.��K��N�N�G�$�$�)NrNNNNF)�numpyr�utilsr�__all__r�r@r?�<module>rEsX�������������)��48�).�p%�p%�p%�p%�p%�p%r@

Youez - 2016 - github.com/yon3zu
LinuXploit