| 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/tests/__pycache__/ |
Upload File : |
�
d�cm � � � d Z ddlZddlmZmZmZ ddlmZ ddl m
Z
ddl mZ ddl mZ dd l m
Z
dd
lmZ d� Z dd
�Zd� Z G d� d� � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � ZdS )z9
Unit test for Linear Programming via Simplex Algorithm.
� N)�assert_�assert_allclose�assert_equal� )�magic_square��_remove_redundancy_svd��_remove_redundancy_pivot_dense)�_remove_redundancy_pivot_sparse��_remove_redundancy_id)�
csc_matrixc �D � t j � d� � d S )N�� )�np�random�seed� � �N/usr/lib/python3/dist-packages/scipy/optimize/tests/test__remove_redundancy.py�setup_moduler s � ��I�N�N�4�����r �H�����z>c �� � t | j � � t | j d� � |�t | j |d||�� � |�t | j |d||�� � d S d S )Nr z*converged to an unexpected objective value)�err_msg�rtol�atolz#converged to an unexpected solution)r �successr �statusr �fun�x)�res�desired_fun� desired_xr r s r �_assert_successr% s� � � �C�K�������Q��������G��@��� � � � � ����E��9��� � � � � � � �r c � � | D ]$}|D ]}t j ||k � � r n� dS �%| j d t j � | � � cxk o"t j � |� � k nc S )zAChecks whether a matrix contains only independent rows of anotherFr )r �all�shape�linalg�matrix_rank)�A�B�rowA�rowBs r �redundancy_removedr/ 7 s� � �� � ��� � �D��v�d�d�l�#�#�
���
� �5�5� �
�7�1�:���.�.�q�1�1�M�M�M�M�R�Y�5J�5J�1�5M�5M�M�M�M�M�Mr c �t � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zd
� Zd� Zd� Zd� Zd� ZdS )�
RRCommonTestsc �$ � d\ }}t j � ||� � }t j � |� � }| � ||� � \ }}}}t ||� � t ||� � t |d� � d S )N��
r4 r )r r �rand�rrr r � �self�m�n�A0�b0�A1�b1r �messages r �test_no_redundancyz RRCommonTests.test_no_redundancyD s� � ����1�
�Y�^�^�A�q�
!�
!��
�Y�^�^�A�
�
��"&�'�'�"�b�/�/���B�����B������B�����V�Q�����r c �� � t j d� � }d|dd d �f<