403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : www-data ( 33)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/numpy/array_api/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/numpy/array_api/__pycache__/linalg.cpython-311.pyc
�

���c�E���ddlmZddlmZmZddlmZddlmZddl	m
Z
ddlmZerdd	l
mZmZmZmZmZdd
lmZddlZddlZGd�d
e��ZGd�de��ZGd�de��ZGd�de��Zdd�dSd�Zdd�dTd"�ZdUd#�Zdd$�dVd&�ZdWd'�ZdUd(�Z dUd)�Z!dXd*�Z"dd+d,�dYd0�Z#dZd2�Z$dd3�d[d6�Z%dUd7�Z&dXd8�Z'dd3�d[d9�Z(d:d;�d\d>�Z)d]d?�Z*d@�Z+dXdA�Z,dBdC�d^dE�Z-d_dG�Z.ddH�d`dK�Z/dd$�dVdL�Z0dd�dTdM�Z1ddddN�dadQ�Z2gdR�Z3dS)b�)�annotations�)�_floating_dtypes�_numeric_dtypes)�reshape)�Array�)�normalize_axis_tuple)�
TYPE_CHECKING)�Literal�Optional�Sequence�Tuple�Union)�
NamedTupleNc�$�eZdZUded<ded<dS)�
EighResultr�eigenvalues�eigenvectorsN��__name__�
__module__�__qualname__�__annotations__���8/usr/lib/python3/dist-packages/numpy/array_api/linalg.pyrrs*����������������rrc�$�eZdZUded<ded<dS)�QRResultr�Q�RNrrrrrrs"��������H�H�H��H�H�H�H�Hrrc�$�eZdZUded<ded<dS)�
SlogdetResultr�sign�	logabsdetNrrrrr#r#s'��������K�K�K������rr#c�.�eZdZUded<ded<ded<dS)�	SVDResultr�U�S�VhNrrrrr'r's+��������H�H�H��H�H�H�
�I�I�I�I�Irr'F)�upper�xrr+�bool�returnc���|jtvrtd���tj�|j��}|rtj|��j	Stj|��S)z�
    Array API compatible wrapper for :py:func:`np.linalg.cholesky <numpy.linalg.cholesky>`.

    See its docstring for more information.
    z2Only floating-point dtypes are allowed in cholesky)
�dtyper�	TypeError�np�linalg�cholesky�_arrayr�_new�mT)r,r+�Ls   rr4r4%s_��	�w�&�&�&��L�M�M�M�
�	���1�8�$�$�A�� ��z�!�}�}����:�a�=�=�r�����axis�x1�x2r;�intc�p�|jtvs|jtvrtd���|j|jkrt	d���|jdkrt	d���|j|dkrt	d���t
jtj	|j
|j
|�����S)zz
    Array API compatible wrapper for :py:func:`np.cross <numpy.cross>`.

    See its docstring for more information.
    z(Only numeric dtypes are allowed in crossz"x1 and x2 must have the same shaperz/cross() requires arrays of dimension at least 1�zcross() dimension must equal 3r:)r0rr1�shape�
ValueError�ndimrr6r2�crossr5)r<r=r;s   rrDrD5s���
�x��&�&�"�(�/�*I�*I��B�C�C�C�	�x�2�8����=�>�>�>�	�w�!�|�|��J�K�K�K�	�x��~�����9�:�:�:��:�b�h�r�y�"�)�$�?�?�?�@�@�@rc��|jtvrtd���tjt
j�|j����S)z�
    Array API compatible wrapper for :py:func:`np.linalg.det <numpy.linalg.det>`.

    See its docstring for more information.
    z-Only floating-point dtypes are allowed in det)	r0rr1rr6r2r3�detr5�r,s rrFrFGsA��	�w�&�&�&��G�H�H�H��:�b�i�m�m�A�H�-�-�.�.�.r)�offsetrHc�`�tjtj|j|dd�����S)z�
    Array API compatible wrapper for :py:func:`np.diagonal <numpy.diagonal>`.

    See its docstring for more information.
    ���r9�rH�axis1�axis2)rr6r2�diagonalr5�r,rHs  rrNrNTs)���:�b�k�!�(�6��2�N�N�N�O�O�Orc���|jtvrtd���tt	t
jtj�	|j
�����S)z�
    Array API compatible wrapper for :py:func:`np.linalg.eigh <numpy.linalg.eigh>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in eigh)r0rr1r�maprr6r2r3�eighr5rGs rrRrR_sJ��	�w�&�&�&��H�I�I�I��s�5�:�r�y�~�~�a�h�'?�'?�@�@�A�Arc��|jtvrtd���tjt
j�|j����S)z�
    Array API compatible wrapper for :py:func:`np.linalg.eigvalsh <numpy.linalg.eigvalsh>`.

    See its docstring for more information.
    z2Only floating-point dtypes are allowed in eigvalsh)	r0rr1rr6r2r3�eigvalshr5rGs rrTrTosC��	�w�&�&�&��L�M�M�M��:�b�i�(�(���2�2�3�3�3rc��|jtvrtd���tjt
j�|j����S)z�
    Array API compatible wrapper for :py:func:`np.linalg.inv <numpy.linalg.inv>`.

    See its docstring for more information.
    z-Only floating-point dtypes are allowed in inv)	r0rr1rr6r2r3�invr5rGs rrVrV|sA��	�w�&�&�&��G�H�H�H��:�b�i�m�m�A�H�-�-�.�.�.rc��|jtvs|jtvrtd���tjtj|j|j����S)z|
    Array API compatible wrapper for :py:func:`np.matmul <numpy.matmul>`.

    See its docstring for more information.
    z)Only numeric dtypes are allowed in matmul)r0rr1rr6r2�matmulr5�r<r=s  rrXrX�sL��
�x��&�&�"�(�/�*I�*I��C�D�D�D��:�b�i��	�2�9�5�5�6�6�6r�fro)�keepdims�ordr[r\�2Optional[Union[int, float, Literal['fro', 'nuc']]]c��|jtvrtd���tjt
j�|jd||�����S)��
    Array API compatible wrapper for :py:func:`np.linalg.norm <numpy.linalg.norm>`.

    See its docstring for more information.
    z5Only floating-point dtypes are allowed in matrix_norm)rJr9�r;r[r\)	r0rr1rr6r2r3�normr5)r,r[r\s   r�matrix_normrb�sJ��	�w�&�&�&��O�P�P�P��:�b�i�n�n�Q�X�H�x�UX�n�Y�Y�Z�Z�Zr�nc��|jtvrtd���tjt
j�|j|����S)z�
    Array API compatible wrapper for :py:func:`np.matrix_power <numpy.matrix_power>`.

    See its docstring for more information.
    zMOnly floating-point dtypes are allowed for the first argument of matrix_power)	r0rr1rr6r2r3�matrix_powerr5)r,rcs  rrere�sG��	�w�&�&�&��g�h�h�h��:�b�i�,�,�Q�X�q�9�9�:�:�:r)�rtolrf�Optional[Union[float, Array]]c�Z�|jdkrtj�d���tj�|jd���}|�T|�dd���t
|jd	d���ztj|j	��j
z}nZt|t��r|j}|�dd���tj
|��d
tjfz}tjtj||kd�����S)z�
    Array API compatible wrapper for :py:func:`np.matrix_rank <numpy.matrix_rank>`.

    See its docstring for more information.
    r	zA1-dimensional array given. Array must be at least two-dimensionalF��
compute_uvNr9T)r;r[rJ.r:)rCr2r3�LinAlgError�svdr5�maxrA�finfor0�eps�
isinstancer�asarray�newaxisr6�
count_nonzero)r,rfr)�tols    r�matrix_rankru�s���	�v��z�z��i�#�#�$g�h�h�h�
�	�
�
�a�h�5�
�1�1�A��|��e�e��d�e�+�+�c�!�'�"�#�#�,�.?�.?�?�"�(�1�7�BS�BS�BW�W����d�E�"�"�	��;�D��e�e��d�e�+�+�B�J�t�,<�,<�S�"�*�_�,M�M���:�b�&�q�3�w�R�8�8�8�9�9�9rc��|jdkrtd���tjt	j|jdd����S)Nr	z5x must be at least 2-dimensional for matrix_transposer9rJ)rCrBrr6r2�swapaxesr5rGs r�matrix_transposerx�s<���v��z�z��P�Q�Q�Q��:�b�k�!�(�B��3�3�4�4�4rc��|jtvs|jtvrtd���|jdks|jdkrt	d���tjtj|j	|j	����S)zz
    Array API compatible wrapper for :py:func:`np.outer <numpy.outer>`.

    See its docstring for more information.
    z(Only numeric dtypes are allowed in outerrz/The input arrays to outer must be 1-dimensional)
r0rr1rCrBrr6r2�outerr5rYs  rrzrz�sr��
�x��&�&�"�(�/�*I�*I��B�C�C�C�
�w�!�|�|�r�w�!�|�|��J�K�K�K��:�b�h�r�y�"�)�4�4�5�5�5rc�&�|jtvrtd���|�;t|jdd���tj|j��jz}tj	t
j
�|j|�����S)z�
    Array API compatible wrapper for :py:func:`np.linalg.pinv <numpy.linalg.pinv>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in pinvNrJ)�rcond)
r0rr1rmrAr2rnrorr6r3�pinvr5)r,rfs  rr}r}�sw��	�w�&�&�&��H�I�I�I��|��1�7�2�3�3�<� � �2�8�A�G�#4�#4�#8�8���:�b�i�n�n�Q�X�T�n�:�:�;�;�;r�reduced��moder��Literal['reduced', 'complete']c	���|jtvrtd���tt	t
jtj�	|j
|������S)z�
    Array API compatible wrapper for :py:func:`np.linalg.qr <numpy.linalg.qr>`.

    See its docstring for more information.
    z,Only floating-point dtypes are allowed in qrr)r0rr1rrQrr6r2r3�qrr5)r,r�s  rr�r��sN��	�w�&�&�&��F�G�G�G��S���R�Y�\�\�!�(��\�%F�%F�G�G�H�Hrc���|jtvrtd���tt	t
jtj�	|j
�����S)z�
    Array API compatible wrapper for :py:func:`np.linalg.slogdet <numpy.linalg.slogdet>`.

    See its docstring for more information.
    z1Only floating-point dtypes are allowed in slogdet)r0rr1r#rQrr6r2r3�slogdetr5rGs rr�r�sL��	�w�&�&�&��K�L�L�L��#�e�j�"�)�*;�*;�A�H�*E�*E�F�F�G�Grc�z�ddlm}m}m}m}m}m}m}ddlm	}	||��\}}
||��||��||��\}}|||��\}}
|j
dkr|	j}n|	j}||��rdnd}||��}|||||���}||�
|
d�	����S)
Nr	)�
_makearray�_assert_stacked_2d�_assert_stacked_square�_commonType�
isComplexType�get_linalg_error_extobj�_raise_linalgerror_singular)�
_umath_linalgrzDD->Dzdd->d)�	signature�extobjF)�copy)�
linalg.linalgr�r�r�r�r�r�r�r3r�rC�solve1�solve�astype)�a�br�r�r�r�r�r�r�r��_�wrap�t�result_t�gufuncr�r��rs                  r�_solver�$sK��>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�'�&�&�&�&�&��:�a�=�=�D�A�q���q������1�����j��m�m�G�A�t��+�a��#�#�K�A�x�	�v��{�{��%����$��)�=��+�+�8����I�
$�
$�%@�
A�
A�F���q�!�y��8�8�8�A��4�������.�.�/�/�/rc��|jtvs|jtvrtd���tjt|j|j����S)z�
    Array API compatible wrapper for :py:func:`np.linalg.solve <numpy.linalg.solve>`.

    See its docstring for more information.
    z/Only floating-point dtypes are allowed in solve)r0rr1rr6r�r5rYs  rr�r�?sL��
�x�'�'�'�2�8�;K�+K�+K��I�J�J�J��:�f�R�Y��	�2�2�3�3�3rT��
full_matricesr�c	���|jtvrtd���tt	t
jtj�	|j
|������S)z�
    Array API compatible wrapper for :py:func:`np.linalg.svd <numpy.linalg.svd>`.

    See its docstring for more information.
    z-Only floating-point dtypes are allowed in svdr�)r0rr1r'rQrr6r2r3rlr5)r,r�s  rrlrlLsN��	�w�&�&�&��G�H�H�H��c�%�*�b�i�m�m�A�H�M�m�&Z�&Z�[�[�\�\r�Union[Array, Tuple[Array, ...]]c��|jtvrtd���tjt
j�|jd�����S)Nz1Only floating-point dtypes are allowed in svdvalsFri)	r0rr1rr6r2r3rlr5rGs r�svdvalsr�]sC���w�&�&�&��K�L�L�L��:�b�i�m�m�A�H��m�?�?�@�@�@r��axesr��/Union[int, Tuple[Sequence[int], Sequence[int]]]c��|jtvs|jtvrtd���tjtj|j|j|�����S)Nz,Only numeric dtypes are allowed in tensordotr�)r0rr1rr6r2�	tensordotr5)r<r=r�s   rr�r�esQ��
�x��&�&�"�(�/�*I�*I��F�G�G�G��:�b�l�2�9�b�i�d�C�C�C�D�D�Drc
��|jtvrtd���tjtjtj|j|dd�������S)zz
    Array API compatible wrapper for :py:func:`np.trace <numpy.trace>`.

    See its docstring for more information.
    z(Only numeric dtypes are allowed in tracerJr9rK)	r0rr1rr6r2rq�tracer5rOs  rr�r�nsR��	�w�o�%�%��B�C�C�C��:�b�j���!�(�6��SU�!V�!V�!V�W�W�X�X�Xrc�R�|jtvs|jtvrtd���t|j|j��}d||jz
zt|j��z}d||jz
zt|j��z}||||krtd���tj	|j
|j
��\}}tj||d��}tj||d��}|dddd�f|dz}tj
|d��S)Nz)Only numeric dtypes are allowed in vecdot)rz6x1 and x2 must have the same size along the given axisr9.).N).rr)r0rr1rmrC�tuplerArBr2�broadcast_arraysr5�moveaxisrr6)	r<r=r;rC�x1_shape�x2_shape�x1_�x2_�ress	         r�vecdotr�{s
��	�x��&�&�"�(�/�*I�*I��C�D�D�D��r�w��� � �D��T�B�G�^�$�u�R�X���6�H��T�B�G�^�$�u�R�X���6�H���~��$��'�'��Q�R�R�R��"�2�9�b�i�8�8�H�C��
�+�c�4��
$�
$�C�
�+�c�4��
$�
$�C�

�c�4����l�
�c�)�n�
,�C��:�c�)�n�%�%�%rr`�%Optional[Union[int, Tuple[int, ...]]]�Optional[Union[int, float]]c�8�
��|jtvrtd���|j�
|��
����
d}n�t|t��r�t||j���t
�fd�t�
j��D����}||z}tj�
|���tj
�
fd�|D��t���g�
fd�|D���R���
d}n|}tjtj��
||�����}|rft'|j��}t|�t|j��n||j��}|D]}	d	||	<�t|t
|����}|S)
r_z.Only floating-point dtypes are allowed in normNrc3�$�K�|]
}|�v�|V��dS)Nr)�.0�i�normalized_axiss  �r�	<genexpr>zvector_norm.<locals>.<genexpr>�s-�����J�J�1��/�1I�1I�Q�1I�1I�1I�1I�J�Jrc�*��g|]}�j|��Sr�rA�r�r�r�s  �r�
<listcomp>zvector_norm.<locals>.<listcomp>�s���/�/�/�Q�a�g�a�j�/�/�/r)r0c�*��g|]}�j|��Srr�r�s  �rr�zvector_norm.<locals>.<listcomp>�s���>X�>X�>X�a�q�w�q�z�>X�>X�>Xr)r;r\r)r0rr1r5�ravelrpr�r
rC�ranger2�	transposer�prodr>rr6r3ra�listrA)r,r;r[r\�_axis�rest�newshaper�rAr�r�r�s          @@r�vector_normr��s�����	�w�&�&�&��H�I�I�I�	
��A��|�
�G�G�I�I�����	�D�%�	 �	 �
�/�t�Q�V�<�<���J�J�J�J��a�f�
�
�J�J�J�J�J���$�;���L��H�%�%�-�-�
�W�/�/�/�/�$�/�/�/�s�
;�
;�
;�Y�>X�>X�>X�>X�SW�>X�>X�>X�Y�Y�
[�
[�������
�*�R�Y�^�^�A�E�s�^�;�;�
<�
<�C��)��Q�W�
�
��$�d�l�U�1�6�]�]�]��a�f�U�U���	�	�A��E�!�H�H��c�5��<�<�(�(���Jr)r4rDrFrNrRrTrVrXrbrerurxrzr}r�r�r�rlr�r�r�r�r�)r,rr+r-r.r)r<rr=rr;r>r.r)r,rr.r)r,rrHr>r.r)r,rr.r)r<rr=rr.r)r,rr[r-r\r]r.r)r,rrcr>r.r)r,rrfrgr.r)r,rr�r�r.r)r,rr.r#)r,rr�r-r.r')r,rr.r�)r<rr=rr�r�r.r)
r,rr;r�r[r-r\r�r.r)4�
__future__r�_dtypesrr�_manipulation_functionsr�
_array_objectr�core.numericr
�typingr�_typingrr
rrrr�numpy.linalg�numpyr2rrr#r'r4rDrFrNrRrTrVrXrbrerurxrzr}r�r�r�r�rlr�r�r�r�r��__all__rrr�<module>r�sp��"�"�"�"�"�"�6�6�6�6�6�6�6�6�,�,�,�,�,�,� � � � � � �/�/�/�/�/�/� � � � � � ��C�B�B�B�B�B�B�B�B�B�B�B�B�B�B������������������������
�
�
�
�
�z�
�
�
������J���������
����,1�
�
�
�
�
�
� 35�A�A�A�A�A�A�$
/�
/�
/�
/�,-�P�P�P�P�P�P�
B�
B�
B�
B� 4�4�4�4�/�/�/�/�7�7�7�7�(27�rw�[�[�[�[�[�[�;�;�;�;�GK�:�:�:�:�:�:�05�5�5�5�6�6�6�6�$@D�<�<�<�<�<�<�"?H�
I�
I�
I�
I�
I�
I�
H�
H�
H�
H�00�0�0�64�4�4�4�/3�
]�
]�
]�
]�
]�
]�"A�A�A�A�cd�E�E�E�E�E�E�)*�
Y�
Y�
Y�
Y�
Y�
Y�46�&�&�&�&�&�&�,OS�ej�PQ�+�+�+�+�+�+�ZF�F�F���r

Youez - 2016 - github.com/yon3zu
LinuXploit