403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.37
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/optimize/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/scipy/optimize/__pycache__/_spectral.cpython-311.pyc
�

d�c����dZddlZddlZddlmZddlmZddlm	Z	m
Z
Gd�de��Z			dd�Z
dd�Zdd�Zd�Zd�ZdS)z,
Spectral Algorithm for Nonlinear Equations
�N)�OptimizeResult)�_check_unknown_options�)�_nonmonotone_line_search_cruz�_nonmonotone_line_search_chengc��eZdZdS)�_NoConvergenceN)�__name__�
__module__�__qualname__���:/usr/lib/python3/dist-packages/scipy/optimize/_spectral.pyr	r	s�������Drr	r
�:�0�yE>�Y��n���F�
绽���|�=��?�cruzc	�4�*�+�,�t|��|
dvrtd|
�d����d�,|
��*fd�}
|��+�,fd�}�,fd�}d	g}t||||||��\}}}�+}}d	}�+�*|}||��}tj�+g|	��}d
}�*}d}d}	||��}|rtd|||fz��|�|||��|||z|zkrd}d
}�nt
|��d|zkrd|ztj|��z}nt
|��|kr|}||z}|
|||��} 	|
dkrt||||| ���\}!}"}#}$n#|
dkrt|||�+||| ���\}!}"}#}$}}n#t$rYnawxYw|"|z
}%|$|z
}&tj|%|%��tj|%|&��z}|"}|$}|#�+|
dkr|�
|#��|dz
}��Mt|||���}'t||��}(t|'|||(|d	|���})|)S)a�
    Solve nonlinear equation with the DF-SANE method

    Options
    -------
    ftol : float, optional
        Relative norm tolerance.
    fatol : float, optional
        Absolute norm tolerance.
        Algorithm terminates when ``||func(x)|| < fatol + ftol ||func(x_0)||``.
    fnorm : callable, optional
        Norm to use in the convergence check. If None, 2-norm is used.
    maxfev : int, optional
        Maximum number of function evaluations.
    disp : bool, optional
        Whether to print convergence process to stdout.
    eta_strategy : callable, optional
        Choice of the ``eta_k`` parameter, which gives slack for growth
        of ``||F||**2``.  Called as ``eta_k = eta_strategy(k, x, F)`` with
        `k` the iteration number, `x` the current iterate and `F` the current
        residual. Should satisfy ``eta_k > 0`` and ``sum(eta, k=0..inf) < inf``.
        Default: ``||F||**2 / (1 + k)**2``.
    sigma_eps : float, optional
        The spectral coefficient is constrained to ``sigma_eps < sigma < 1/sigma_eps``.
        Default: 1e-10
    sigma_0 : float, optional
        Initial spectral coefficient.
        Default: 1.0
    M : int, optional
        Number of iterates to include in the nonmonotonic line search.
        Default: 10
    line_search : {'cruz', 'cheng'}
        Type of line search to employ. 'cruz' is the original one defined in
        [Martinez & Raydan. Math. Comp. 75, 1429 (2006)], 'cheng' is
        a modified search defined in [Cheng & Li. IMA J. Numer. Anal. 29, 814 (2009)].
        Default: 'cruz'

    References
    ----------
    .. [1] "Spectral residual method without gradient information for solving
           large-scale nonlinear systems of equations." W. La Cruz,
           J.M. Martinez, M. Raydan. Math. Comp. **75**, 1429 (2006).
    .. [2] W. La Cruz, Opt. Meth. Software, 29, 24 (2014).
    .. [3] W. Cheng, D.-H. Li. IMA J. Numer. Anal. **29**, 814 (2009).

    )�chengrzInvalid value z for 'line_search'�Nc����d|zdzzS)Nrrr
)�k�x�F�f_0s   �r�eta_strategyz#_root_df_sane.<locals>.eta_strategyJs����!�a�%�!��#�#rc����d�zzS)Nrr
)r�f_k�nexps ��r�fnormz_root_df_sane.<locals>.fnormOs�����T��?�"rc�H��tj�|���zS�N)�np�linalg�norm)rr"s �r�fmeritz_root_df_sane.<locals>.fmeritSs����y�~�~�a� � �$�&�&rrrFz&too many function evaluations requiredTziter %d: ||F|| = %g, sigma = %gzsuccessful convergencerr)�etar)�shape)r�success�message�fun�nfev�nit)r�
ValueError�
_wrap_func�collections�deque�print�absr&�signrrr	�vdot�append�_wrap_resultr)-�func�x0�args�ftol�fatol�maxfevr#�callback�disp�Mr�	sigma_eps�sigma_0�line_search�unknown_optionsr)r/�f�x_k�x_shape�F_k�
is_complexr�sigma_k�F_0_norm�prev_fs�Q�C�	convergedr-�F_k_norm�dr*�alpha�xp�fp�Fp�s_k�y_krr�resultrr!r"s-                                          @@@r�
_root_df_saner\s?�����b�?�+�+�+��+�+�+��j����N�O�O�O��D���	$�	$�	$�	$�	$�
�}�	#�	#�	#�	#�	#�	#�'�'�'�'�'�
�3�D�,6�t�R���v�W[�,\�,\�)�A�s�G�S�#�z�	�A�

�C��G��u�S�z�z�H�����q�)�)�G�	�A��A��I�6�G�0��5��:�:���	N��3�q�(�G�6L�L�M�M�M����H�S�#�����d�X�o��-�-�-�.�G��I���w�<�<�!�I�+�%�%��	�k�B�G�G�$4�$4�4�G�G�
��\�\�I�
%�
%��G��H�s�N���l�1�c�3�'�'��	��f�$�$�$A�!�S�!�W�Z]�$^�$^�$^�!��r�2�r�r���'�'�*H��C�QR�TW�YZ�\]�cf�*g�*g�*g�'��r�2�r�1�a����	�	�	��E�	�����3�h���3�h���'�#�s�#�#�b�g�c�3�&7�&7�7���������&� � ��N�N�2����	�Q���a0�d	�S�*�G�4�4�4�A��S�*�%�%�A�
�a��$+� !��Q��Q�8�8�8�F��Ms�*AE.�.
E;�:E;c�������	�tj|��}|j�	tj�|g��R������}tj|��ptj|��}|���}d�d<|r)������	fd�}t|��}t|��}n
������	fd�}||�	�|��||fS)a�
    Wrap a function and an initial value so that (i) complex values
    are wrapped to reals, and (ii) value for a merit function
    fmerit(x, f) is computed at the same time, (iii) iteration count
    is maintained and an exception is raised if it is exceeded.

    Parameters
    ----------
    func : callable
        Function to wrap
    x0 : ndarray
        Initial value
    fmerit : callable
        Merit function fmerit(f) for computing merit value from residual.
    nfev_list : list
        List to store number of evaluations in. Should be [0] in the beginning.
    maxfev : int
        Maximum number of evaluations before _NoConvergence is raised.
    args : tuple
        Extra arguments to func

    Returns
    -------
    wrap_func : callable
        Wrapped function, to be called as
        ``F, fp = wrap_func(x0)``
    x0_wrap : ndarray of float
        Wrapped initial value; raveled to 1-D and complex
        values mapped to reals.
    x0_shape : tuple
        Shape of the initial value array
    f : float
        Merit function at F
    F : ndarray of float
        Residual at x0_wrap
    is_complex : bool
        Whether complex values were mapped to reals

    rrc�2���	d�krt����	dxxdz
cc<t|����
��}tj�|g��R������}t
|��}�|��}||fS�Nrr)r	�
_real2complex�reshaper&�asarray�ravel�
_complex2real)r�z�vrrHr=r)r;r@�	nfev_list�x0_shapes     ������r�	wrap_funcz_wrap_func.<locals>.wrap_func�s������|�v�%�%�$�&�&�&��a�L�L�L�A��L�L�L��a� � �(�(��2�2�A��
�4�4��>�D�>�>�>�*�*�0�0�2�2�A��a� � �A���q�	�	�A��a�4�Krc����d�krt����dxxdz
cc<|����}tj�|g��R������}�|��}||fSr_)r	rar&rbrc)	rrrHr=r)r;r@rgrhs	   ������rriz_wrap_func.<locals>.wrap_func�s������|�v�%�%�$�&�&�&��a�L�L�L�A��L�L�L��	�	�(�#�#�A��
�4�4��>�D�>�>�>�*�*�0�0�2�2�A���q�	�	�A��a�4�Kr)r&rbr+rc�iscomplexobjrd)
r;r<r)rgr@r=rrLrirhs
` ````   @rr2r2�s#��������P
��B���B��x�H�
�
�4�4��?�T�?�?�?�#�#�)�)�+�+�A����$�$�:����(:�(:�J�	�����B��I�a�L���	�	�	�	�	�	�	�	�	�	��2�
�
���!�����	�	�	�	�	�	�	�	�	�	��b�(�F�F�1�I�I�q�*�<�<rc�\�|rt|��}n|}|�|�|��}|S)zA
    Convert from real to complex and reshape result arrays.
    )r`ra)r[rLr+res    rr:r:�s<�����&�!�!�������
�I�I�e�����Hrc�r�tj|t����tj��S�N)�dtype)r&�ascontiguousarray�float�view�
complex128)rs rr`r`�s(��
����/�/�/�4�4�R�]�C�C�Crc�r�tj|t����tj��Srn)r&rp�complexrr�float64)res rrdrds(��
����1�1�1�6�6�r�z�B�B�Br)r
rrrNNFrNrrr)r
r%)�__doc__r3�numpyr&�scipy.optimizer�scipy.optimize._optimizer�_linesearchrr�	Exceptionr	r\r2r:r`rdr
rr�<module>r}s������������)�)�)�)�)�)�;�;�;�;�;�;�V�V�V�V�V�V�V�V�	�	�	�	�	�Y�	�	�	�FJ�LP�<B�S�S�S�S�lG=�G=�G=�G=�T

�

�

�

�D�D�D�C�C�C�C�Cr

Youez - 2016 - github.com/yon3zu
LinuXploit