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_dogleg.cpython-311.pyc
�

d�c%��R�dZddlZddlZddlmZmZgZd	d�Z	Gd�de��Z
dS)
z"Dog-leg trust-region optimization.�N�)�_minimize_trust_region�BaseQuadraticSubproblem�c��|�td���t|��std���t||f|||td�|��S)a 
    Minimization of scalar function of one or more variables using
    the dog-leg 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 dogleg minimizationz+Hessian is required for dogleg minimization)�args�jac�hess�
subproblem)�
ValueError�callabler�DoglegSubproblem)�fun�x0rr	r
�trust_region_optionss      �D/usr/lib/python3/dist-packages/scipy/optimize/_trustregion_dogleg.py�_minimize_doglegr	sg��(�{��G�H�H�H��D�>�>�H��F�G�G�G�!�#�r�:��#�D�-=�:�:�$8�:�:�:�c�$�eZdZdZd�Zd�Zd�ZdS)rz0Quadratic subproblem solved by the dogleg methodc��|j�P|j}|�|��}tj||��tj||��z|z|_|jS)zV
        The Cauchy point is minimal along the direction of steepest descent.
        )�
_cauchy_pointr	�hessp�np�dot)�self�g�Bgs   r�cauchy_pointzDoglegSubproblem.cauchy_point)sU����%���A����A���B�#%�6�!�Q�<�<�"�&��B�-�-�#?�!@�1�!D�D���!�!rc���|j�S|j}|j}tj�|��}tj�||��|_|jS)zS
        The Newton point is a global minimum of the approximate function.
        )�
_newton_pointr	r
�scipy�linalg�
cho_factor�	cho_solve)rr�B�cho_infos    r�newton_pointzDoglegSubproblem.newton_point3sV����%���A��	�A��|�.�.�q�1�1�H�"'�,�"8�"8��1�"E�"E�!E�D���!�!rc�f�|���}tj�|��|krd}||fS|���}tj�|��}||kr|||zz}d}||fS|�|||z
|��\}}||||z
zz}d}||fS)a�
        Minimize a function using the dog-leg trust-region algorithm.

        This algorithm requires function values and first and second derivatives.
        It also performs a costly Hessian decomposition for most iterations,
        and the Hessian is required to be positive definite.

        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
        -----
        The Hessian is required to be positive definite.

        References
        ----------
        .. [1] Jorge Nocedal and Stephen Wright,
               Numerical Optimization, second edition,
               Springer-Verlag, 2006, page 73.
        FT)r'r!r"�normr�get_boundaries_intersections)	r�trust_radius�p_best�
hits_boundary�p_u�p_u_norm�
p_boundary�_�tbs	         r�solvezDoglegSubproblem.solve>s���D�"�"�$�$���<���V�$�$�|�3�3�!�M��=�(�(����!�!���<�$�$�S�)�)���|�#�#���x� 7�8�J� �M��}�,�,��1�1�#�v��|�2>�@�@���2��2��#��.�.�
��
��=�(�(rN)�__name__�
__module__�__qualname__�__doc__rr'r3rrrrr&sG������:�:�"�"�"�	"�	"�	"�<)�<)�<)�<)�<)rr)rNN)r7�numpyr�scipy.linalgr!�_trustregionrr�__all__rrrrr�<module>r<s���(�(���������K�K�K�K�K�K�K�K�
��:�:�:�:�:T)�T)�T)�T)�T)�.�T)�T)�T)�T)�T)r

Youez - 2016 - github.com/yon3zu
LinuXploit