| 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 : |
�
d�cK: � �x � d dl Z d dlZd dlmZmZ ddlmZ ddlm Z m
Z
ddlmZ ddl
mZ d� Zd � Zddddd
�d�ZdS )� N)� csc_array�vstack� )�_highs_wrapper)�LinearConstraint�Bounds)�OptimizeResult)�_highs_to_scipy_status_messagec � � d}g }g }g }t | t � � r| g} nt t | � � n"# t $ r}t |� � |�d}~ww xY wt | � � dk r. t | � g} n"# t t t j f$ r Y nw xY w| D ]�}t |t � � s- t |� }n"# t $ r}t |� � |�d}~ww xY w|� t |j
� � � � |� t
j |j � � �
t j � � � � |� t
j |j � � �
t j � � � � ��t |� � dk r8t! |� � }t
j |� � }t
j |� � } n|d }|d }|d } ||| fS )a�
Convert sequence of constraints to a single set of components A, b_l, b_u.
`constraints` could be
1. A LinearConstraint
2. A tuple representing a LinearConstraint
3. An invalid object
4. A sequence of composed entirely of objects of type 1/2
5. A sequence containing at least one object of type 3
We want to accept 1, 2, and 4 and reject 3 and 5.
�`constraints` (or each element within `constraints`) must be convertible into an instance of `scipy.optimize.LinearConstraint`.N� r r )�
isinstancer �iter� TypeError�
ValueError�len�np�VisibleDeprecationWarning�appendr �A�
atleast_1d�lb�astype�double�ubr �concatenate)
�constraints�message�As�b_ls�b_us�exc�
constraintr �b_l�b_us
�6/usr/lib/python3/dist-packages/scipy/optimize/_milp.py�_constraints_to_componentsr'