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

d�c���Z�dZddlZddlZddlZddlmZmZgZ	d	d�Z
Gd�de��ZdS)
z$Newton-CG trust-region optimization.�N�)�_minimize_trust_region�BaseQuadraticSubproblem�c	�|�|�td���|�|�td���t||f||||td�|��S)a2
    Minimization of scalar function of one or more variables using
    the Newton conjugate gradient trust-region algorithm.

    Options
    -------
    initial_trust_radius : float
        Initial trust-region radius.
    max_trust_radius : float
        Maximum value of the trust-region radius. No steps that are longer
        than this value will be proposed.
    eta : float
        Trust region related acceptance stringency for proposed steps.
    gtol : float
        Gradient norm must be less than `gtol` before successful
        termination.

    Nz<Jacobian is required for Newton-CG trust-region minimizationzdEither the Hessian or the Hessian-vector product is required for Newton-CG trust-region minimization)�args�jac�hess�hessp�
subproblem)�
ValueErrorr�CGSteihaugSubproblem)�fun�x0rr	r
r�trust_region_optionss       �A/usr/lib/python3/dist-packages/scipy/optimize/_trustregion_ncg.py�_minimize_trust_ncgrsx��(�{��(�)�)�	)��|��
��O�P�P�	P�!�#�r�:��#�D�(-�:N�:�:�$8�:�:�:�c��eZdZdZd�ZdS)rz:Quadratic subproblem solved by a conjugate gradient methodc�D�tj|j��}tdt	j|j����|jz}|j|krd}||fS|}|j}|}	|�|��}tj||��}	|	dkrM|�	|||��\}
}||
|zz}|||zz}
||��||
��kr|}n|
}d}||fStj||��}||	z}|||zz}tj�|��|kr(|�	|||��\}
}|||zz}d}||fS|||zz}tj||��}t	j|��|krd}||fS||z}|||zz}|}|}|}��;)a�
        Solve the subproblem using a conjugate gradient method.

        Parameters
        ----------
        trust_radius : float
            We are allowed to wander only this far away from the origin.

        Returns
        -------
        p : ndarray
            The proposed step.
        hits_boundary : bool
            True if the proposed step is on the boundary of the trust region.

        Notes
        -----
        This is algorithm (7.2) of Nocedal and Wright 2nd edition.
        Only the function that computes the Hessian-vector product is required.
        The Hessian itself is not required, and the Hessian does
        not need to be positive semidefinite.
        g�?FTr)
�np�
zeros_liker	�min�math�sqrt�jac_magr�dot�get_boundaries_intersections�scipy�linalg�norm)�self�trust_radius�p_origin�	tolerance�
hits_boundary�z�r�d�Bd�dBd�ta�tb�pa�pb�
p_boundary�	r_squared�alpha�z_next�r_next�r_next_squared�	beta_next�d_nexts                      r�solvezCGSteihaugSubproblem.solve,s���2�=���*�*����T�Y�t�|�4�4�5�5���D�	��<�)�#�#�!�M��]�*�*�
���H��
�B��(	����A���B��&��B�-�-�C��a�x�x�
�:�:�1�a��N�N���B���a��Z����a��Z���4��8�8�d�d�2�h�h�&�&�!#�J�J�!#�J� $�
�!�=�0�0���q�!���I���O�E�����]�F��|� � ��(�(�L�8�8��:�:�1�a��N�N���B���a��Z�
� $�
�!�=�0�0�����^�F��V�F�F�3�3�N��y��(�(�9�4�4� %�
��}�,�,�&��2�I��W�y�1�}�,�F��A��A��A�Q(	rN)�__name__�
__module__�__qualname__�__doc__r8rrrrr*s.������D�D�R�R�R�R�Rrr)rNNN)r<r�numpyr�scipy.linalgr�_trustregionrr�__all__rrrrr�<module>rAs���*�*�������������K�K�K�K�K�K�K�K�
��:�:�:�:�>T�T�T�T�T�2�T�T�T�T�Tr

Youez - 2016 - github.com/yon3zu
LinuXploit