| 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 : /usr/lib/python3/dist-packages/scipy/optimize/__pycache__/ |
Upload File : |
�
d�c�u � �� � d Z ddlZddlmZ ddlmZmZ ddlmZ ddl m
Z
ddlmZ dgZ
G d � d
� � Z G d� d� � Z G d
� d� � Z G d� d� � Z G d� d� � Z dd�ZdS )z0
A Dual Annealing global optimization algorithm
� N)�OptimizeResult)�minimize�Bounds)�gammaln)�check_random_state)�new_bounds_to_old�dual_annealingc �, � e Zd ZdZdZdZd� Zd� Zd� ZdS )�VisitingDistributionaA
Class used to generate new coordinates based on the distorted
Cauchy-Lorentz distribution. Depending on the steps within the strategy
chain, the class implements the strategy for generating new location
changes.
Parameters
----------
lb : array_like
A 1-D NumPy ndarray containing lower bounds of the generated
components. Neither NaN or inf are allowed.
ub : array_like
A 1-D NumPy ndarray containing upper bounds for the generated
components. Neither NaN or inf are allowed.
visiting_param : float
Parameter for visiting distribution. Default value is 2.62.
Higher values give the visiting distribution a heavier tail, this
makes the algorithm jump to a more distant region.
The value range is (1, 3]. Its value is fixed for the life of the
object.
rand_gen : {`~numpy.random.RandomState`, `~numpy.random.Generator`}
A `~numpy.random.RandomState`, `~numpy.random.Generator` object
for using the current state of the created random generator container.
g �חA绽���|�=c �� � || _ || _ || _ || _ ||z
| _ t j d| j z
t j | j dz
� � z � � | _ t j d| j z
t j d� � z | j dz
z � � | _ t j
t
j � � | j z | j d| j z
z z | _ d| j dz
z dz
| _
d| j
z
| _ t
j d| j
z
z t j t
j d| j
z
z � � z t j t! | j � � � � z | _ d S )Ng @� �?� @� @g �?)�_visiting_param�rand_gen�lower�upper�bound_range�np�exp�log�_factor2�_factor3�sqrt�pi�
_factor4_p�_factor5�_d1�sinr �_factor6)�self�lb�ub�visiting_paramr s �@/usr/lib/python3/dist-packages/scipy/optimize/_dual_annealing.py�__init__zVisitingDistribution.__init__1 sX � �
.��� ��
���
���
���7��� ���d�&:� :�b�f�� �3�&�?(� ?(� (� )� )��
����d�&:� :�b�f�S�k�k�I�"&�"6��"<� >� ?� ?��
��'�"�%�.�.�4�=�8�D�M��$�&�&�=(� )��� �t�3�c�9�:�S�@��
����&������t�}�!4�5����E�S�4�=�(�)�9+� 9+� +�-/�V�G�D�H�4E�4E�-F�-F�G��
�
�
� c � � |j }||k r�| � ||� � }| j � d�� � \ }}| j |z ||| j k <