| 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 : |
�
d�c�v � �, � d Z g d�ZddlZddlmZ ddlZddlmZ ddl m
Z
ddlmZ dd l
mZ dd
lmZ ddd
dd�ZdZdZd� Zd� Zd+d�Z eddd�� � e� � d,d�� � � � Z eddd�� � e� � d,d �� � � � Z ed!d"d#�� � e� � d,d$�� � � � Z ed%d&d'�� � e� � d,d(�� � � � Z e� � d-d)�� � Z e� � d.d*�� � ZdS )/z,Iterative methods for solving linear systems)�bicg�bicgstab�cg�cgs�gmres�qmr� N)�dedent� )�
_iterative)�LinearOperator)�make_system)�_aligned_zeros)�
non_reentrant�s�d�c�z)�fr �F�DzC
Parameters
----------
A : {sparse matrix, ndarray, LinearOperator}aX 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.
tol, atol : float, optional
Tolerances for convergence, ``norm(residual) <= max(tol*norm(b), atol)``.
The default for ``atol`` is ``'legacy'``, which emulates
a different legacy behavior.
.. warning::
The default value for `atol` will be changed in a future release.
For future compatibility, specify `atol` explicitly.
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.
c �\ � t j � | � � }||k r|dfS |dfS )z;
Successful termination condition for the solvers.
r
r ��np�linalg�norm)�residual�atol�resids �G/usr/lib/python3/dist-packages/scipy/sparse/linalg/_isolve/iterative.py� _stoptestr C s2 � �
�I�N�N�8�$�$�E���}�}��a�x���a�x�� c �F � |�2t j d� |�� � t d�� � d}t | � � } |dk r, |� � }|| k rdS |dk r| S | t |� � z S t t |� � | t |� � z � � S ) a�
Parse arguments for absolute tolerance in termination condition.
Parameters
----------
tol, atol : object
The arguments passed into the solver routine by user.
bnrm2 : float
2-norm of the rhs vector.
get_residual : callable
Callable ``get_residual()`` that returns the initial value of
the residual.
routine_name : str
Name of the routine.
Na scipy.sparse.linalg.{name} called without specifying `atol`. The default value will be changed in a future release. For compatibility, specify a value for `atol` explicitly, e.g., ``{name}(..., atol=0)``, or to retain the old behavior ``{name}(..., atol='legacy')``)�name� ��category�
stacklevel�legacy�exitr )�warnings�warn�format�DeprecationWarning�float�max)�tolr �bnrm2�get_residual�routine_namer s r � _get_atolr4 N s� � �"