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/linalg/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/scipy/linalg/__pycache__/_matfuncs_sqrtm.cpython-311.pyc
�

d�c����dZdgZddlZddlmZddlmZddlm	Z	m
Z
ddlmZm
Z
Gd	�d
ejj��ZddlmZdd
�Zdd�ZdS)zz
Matrix square root for general matrices and for upper triangular matrices.

This module exists to avoid cyclic imports.

�sqrtm�N)�_asarray_validated�)�norm)�ztrsyl�dtrsyl)�schur�rsf2csfc��eZdZdS)�
SqrtmErrorN)�__name__�
__module__�__qualname__���>/usr/lib/python3/dist-packages/scipy/linalg/_matfuncs_sqrtm.pyrrs�������Drr)�within_block_loop�@c	�6�tj|��}tj|��otj|��dk}|sBtj|tjd���}tj|tj���}nAtj|tjd���}tj|tj���}tjtj|����}|j\}}t||zd��}t||��\}}|dz}	||z
}
|
|z||	zz|krtd���g}d}|
|f||	ffD]6\}
}t|
��D]!}|�
|||zf��||z
}�"�7	t||||��n!#t$r}t!|j�|�d}~wwxYwt|��D]�}||\}}t|dz
dd��D]�}||\}}|||�||�f}||z
dkr0||||�||�f�|||�||�f��z
}|||�||�f}|||�||�f}|rt'|||��\}}}nt)|||��\}}}||z|||�||�f<����|S)	a�
    Matrix square root of an upper triangular matrix.

    This is a helper function for `sqrtm` and `logm`.

    Parameters
    ----------
    T : (N, N) array_like upper triangular
        Matrix whose square root to evaluate
    blocksize : int, optional
        If the blocksize is not degenerate with respect to the
        size of the input array, then use a blocked algorithm. (Default: 64)

    Returns
    -------
    sqrtm : (N, N) ndarray
        Value of the sqrt function at `T`

    References
    ----------
    .. [1] Edvin Deadman, Nicholas J. Higham, Rui Ralha (2013)
           "Blocked Schur Algorithms for Computing the Matrix Square Root,
           Lecture Notes in Computer Science, 7782. pp. 171-182.

    r�C)�dtype�order)rrzinternal inconsistencyN���)�np�diag�	isrealobj�min�asarray�
complex128�float64�sqrt�shape�max�divmod�	Exception�range�appendr�RuntimeErrorr�args�dotrr)�T�	blocksize�T_diag�keep_it_real�R�n�nblocks�bsmall�nlarge�blarge�nsmall�start_stop_pairs�start�count�size�i�e�j�jstart�jstop�istart�istop�S�Rii�Rjj�x�scale�infos                            r�_sqrtm_triurGs.��4�W�Q�Z�Z�F��<��?�?�:�r�v�f�~�~��':�L��6��J�q��
�S�9�9�9����F�"�-�8�8�8����J�q��
�#�6�6�6����F�"�*�5�5�5��
������� � �A�
�7�D�A�q��!�y�.�!�$�$�G��A�w�'�'�N�F�F�
�a�Z�F�
�v�
�F�
����&��(�A�-�-��0�1�1�1���
�E���(�6�6�*:�;�����t��u���	�	�A��#�#�U�E�D�L�$9�:�:�:��T�M�E�E�	�
)��!�Q� 0�'�:�:�:�:���)�)�)��!�&�!�q�(�����)�����7�^�^�6�6��(��+�
����q��s�B��#�#�	6�	6�A�,�Q�/�M�F�E��&��,��u��,�-�A��1�u�q�y�y���&��,��f��4�5�9�9�!�E�&�L�<B�5�L�=I�;J�K�K�K���F�5�L�&��,�.�/�C��F�5�L�&��,�.�/�C��
5�!'��S�!�!4�!4���5�$�$�!'��S�!�!4�!4���5�$�,-��I�A�f�U�l�F�5�L�(�)�)�!	6�&
�Hs�F�
F9�%F4�4F9Tc�V�tj|��jj}t	|dd���}t|j��dkrtd���|dkrtd���tj|��}|rMt|��\}}tj
|tj|����st||��\}}nt|d���\}}d	}	t||�
��}tj|��j}	|�|���|	��}
tj|
��s/|
�dtj|dd����d	�
��}
nxt)td��r2|
�dtj|dzdd����d	�
��}
n1|
�dtj|dzdd����d	�
��}
nE#t*$r8d}tj|��}
|
�tj��YnwxYw|r|rt3d��|
S	t5|
�|
��|z
d��dzt5|d��z}n#t$rtj}YnwxYw|
|fS)a�
    Matrix square root.

    Parameters
    ----------
    A : (N, N) array_like
        Matrix whose square root to evaluate
    disp : bool, optional
        Print warning if error in the result is estimated large
        instead of returning estimated error. (Default: True)
    blocksize : integer, optional
        If the blocksize is not degenerate with respect to the
        size of the input array, then use a blocked algorithm. (Default: 64)

    Returns
    -------
    sqrtm : (N, N) ndarray
        Value of the sqrt function at `A`. The dtype is float or complex.
        The precision (data size) is determined based on the precision of
        input `A`. When the dtype is float, the precision is same as `A`.
        When the dtype is complex, the precition is double as `A`. The
        precision might be cliped by each dtype precision range.

    errest : float
        (if disp == False)

        Frobenius norm of the estimated error, ||err||_F / ||A||_F

    References
    ----------
    .. [1] Edvin Deadman, Nicholas J. Higham, Rui Ralha (2013)
           "Blocked Schur Algorithms for Computing the Matrix Square Root,
           Lecture Notes in Computer Science, 7782. pp. 171-182.

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.linalg import sqrtm
    >>> a = np.array([[1.0, 3.0], [1.0, 4.0]])
    >>> r = sqrtm(a)
    >>> r
    array([[ 0.75592895,  1.13389342],
           [ 0.37796447,  1.88982237]])
    >>> r.dot(r)
    array([[ 1.,  3.],
           [ 1.,  4.]])

    T)�check_finite�
as_inexact�z$Non-matrix input to matrix function.rz#The blocksize should be at least 1.�complex)�outputF)r,�f�)�copy�
complex256�c�� zFailed to find a square root.�fro)rrr�itemsizer�lenr"�
ValueErrorrr	�array_equal�triur
rG�	conjugater+r*�iscomplexobj�astype�clip�hasattrr�
empty_like�fill�nan�printr�inf)�A�dispr,�	byte_sizer.r+�Z�failflagr/�ZH�X�arg2s            rrrus���b�
�1�
�
�#�,�I��1�4�D�A�A�A�A�
�1�7�|�|�q����?�@�@�@��1�}�}��>�?�?�?��<��?�?�L��*��Q�x�x���1��~�a������,�,�	!��1�a�=�=�D�A�q���Q�y�)�)�)���1��H����Y�/�/�/��
�\�!�_�_�
��
�E�E�!�H�H�L�L�������q�!�!�		L����8�R�W�Y��2�6�6�8�8�u��E�E�A�A��r�<�(�(�
L��H�H�>����1��a��!<�!<�>�>�U�H�K�K����H�H�>����1��a��!<�!<�>�>�U�H�K�K�����������M�!����	���r�v����������
���	3��1�2�2�2���	�����a���1��e�,�,�a�/�$�q�%�.�.�@�D�D���	�	�	��6�D�D�D�	�����$�w�s%�'D
G5�5?H7�6H7�:J�J$�#J$)r)Tr)�__doc__�__all__�numpyr�scipy._lib._utilr�_miscr�lapackrr�
_decomp_schurr	r
�linalg�LinAlgErrorr�_matfuncs_sqrtm_triurrGrrrr�<module>rws������)������/�/�/�/�/�/�������"�"�"�"�"�"�"�"�)�)�)�)�)�)�)�)�	�	�	�	�	���&�	�	�	�4�3�3�3�3�3�W
�W
�W
�W
�t]�]�]�]�]�]r

Youez - 2016 - github.com/yon3zu
LinuXploit