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__/_decomp_schur.cpython-311.pyc
�

d�c (�
��dZddlZddlmZmZmZmZddlmZddlm	Z	m
Z
ddlmZddl
mZd	d
gZgd�Z		dd�Zeje��jZeje��jZdddddddddd�	Zddddddd�ZddgddggZd�Zd�Zdd�ZdS)zSchur decomposition functions.�N)�asarray_chkfinite�single�asarray�array)�norm�)�LinAlgError�_datacopied)�get_lapack_funcs)�eigvals�schur�rsf2csf)�i�l�d�realFTc��|dvrtd���|rt|��}nt|��}t|j��dks|jd|jdkrtd���|jj}|dvr<|dvr8|tvr|�d	��}d	}n|�d
��}d
}|pt||��}td|f��\}|�|d
kr?|d�|d
���}	|	ddj�tj
��}|�d}
d�}nKd}
t|��r|}n7|dkrd�}n-|dkrd�}n#|dkrd�}n|dkrd�}ntd���||||||
���}	|	d
}|dkr#td�|�����||jddzkrt!d���||jddzkrt!d���|dkrt!d���|
dkr|	d|	d fS|	d|	d |	dfS)!a�
    Compute Schur decomposition of a matrix.

    The Schur decomposition is::

        A = Z T Z^H

    where Z is unitary and T is either upper-triangular, or for real
    Schur decomposition (output='real'), quasi-upper triangular. In
    the quasi-triangular form, 2x2 blocks describing complex-valued
    eigenvalue pairs may extrude from the diagonal.

    Parameters
    ----------
    a : (M, M) array_like
        Matrix to decompose
    output : {'real', 'complex'}, optional
        Construct the real or complex Schur decomposition (for real matrices).
    lwork : int, optional
        Work array size. If None or -1, it is automatically computed.
    overwrite_a : bool, optional
        Whether to overwrite data in a (may improve performance).
    sort : {None, callable, 'lhp', 'rhp', 'iuc', 'ouc'}, optional
        Specifies whether the upper eigenvalues should be sorted. A callable
        may be passed that, given a eigenvalue, returns a boolean denoting
        whether the eigenvalue should be sorted to the top-left (True).
        Alternatively, string parameters may be used::

            'lhp'   Left-hand plane (x.real < 0.0)
            'rhp'   Right-hand plane (x.real > 0.0)
            'iuc'   Inside the unit circle (x*x.conjugate() <= 1.0)
            'ouc'   Outside the unit circle (x*x.conjugate() > 1.0)

        Defaults to None (no sorting).
    check_finite : bool, optional
        Whether to check that the input matrix contains only finite numbers.
        Disabling may give a performance gain, but may result in problems
        (crashes, non-termination) if the inputs do contain infinities or NaNs.

    Returns
    -------
    T : (M, M) ndarray
        Schur form of A. It is real-valued for the real Schur decomposition.
    Z : (M, M) ndarray
        An unitary Schur transformation matrix for A.
        It is real-valued for the real Schur decomposition.
    sdim : int
        If and only if sorting was requested, a third return value will
        contain the number of eigenvalues satisfying the sort condition.

    Raises
    ------
    LinAlgError
        Error raised under three conditions:

        1. The algorithm failed due to a failure of the QR algorithm to
           compute all eigenvalues.
        2. If eigenvalue sorting was requested, the eigenvalues could not be
           reordered due to a failure to separate eigenvalues, usually because
           of poor conditioning.
        3. If eigenvalue sorting was requested, roundoff errors caused the
           leading eigenvalues to no longer satisfy the sorting condition.

    See Also
    --------
    rsf2csf : Convert real Schur form to complex Schur form

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.linalg import schur, eigvals
    >>> A = np.array([[0, 2, 2], [0, 1, 2], [1, 0, 1]])
    >>> T, Z = schur(A)
    >>> T
    array([[ 2.65896708,  1.42440458, -1.92933439],
           [ 0.        , -0.32948354, -0.49063704],
           [ 0.        ,  1.31178921, -0.32948354]])
    >>> Z
    array([[0.72711591, -0.60156188, 0.33079564],
           [0.52839428, 0.79801892, 0.28976765],
           [0.43829436, 0.03590414, -0.89811411]])

    >>> T2, Z2 = schur(A, output='complex')
    >>> T2
    array([[ 2.65896708, -1.22839825+1.32378589j,  0.42590089+1.51937378j],
           [ 0.        , -0.32948354+0.80225456j, -0.59877807+0.56192146j],
           [ 0.        ,  0.                    , -0.32948354-0.80225456j]])
    >>> eigvals(T2)
    array([2.65896708, -0.32948354+0.80225456j, -0.32948354-0.80225456j])

    An arbitrary custom eig-sorting condition, having positive imaginary part,
    which is satisfied by only one eigenvalue

    >>> T3, Z3, sdim = schur(A, output='complex', sort=lambda x: x.imag > 0)
    >>> sdim
    1

    )r�complex�r�cz%argument must be 'real', or 'complex'�rrzexpected square matrix)rr)�F�Drr)�geesN���c��dS�N���xs �</usr/lib/python3/dist-packages/scipy/linalg/_decomp_schur.py�<lambda>zschur.<locals>.<lambda>�s����)�lwork���c��dSrrrs r!r"zschur.<locals>.<lambda>�s��d�r#�lhpc��|jdkS�N��rrs r!r"zschur.<locals>.<lambda>�s��1�6�C�<�r#�rhpc��|jdkSr)r+rs r!r"zschur.<locals>.<lambda>�s��1�6�S�=�r#�iucc�(�t|��dkS�Ng�?��absrs r!r"zschur.<locals>.<lambda>�s��3�q�6�6�S�=�r#�oucc�(�t|��dkSr0r1rs r!r"zschur.<locals>.<lambda>�s��3�q�6�6�C�<�r#zZ'sort' parameter must either be 'None', or a callable, or one of ('lhp','rhp','iuc','ouc'))r$�overwrite_a�sort_tz0illegal value in {}-th argument of internal geesz2Eigenvalues could not be separated for reordering.z2Leading eigenvalues do not satisfy sort condition.z/Schur form not found. Possibly ill-conditioned.���)�
ValueErrorrr�len�shape�dtype�char�_double_precision�astyper
rr�numpy�int_�callable�formatr	)
�a�outputr$r5�sort�check_finite�a1�typr�resultr6�	sfunction�infos
             r!r
r
s���H�2�2�2��@�A�A�A���
�q�
!�
!���
�Q�Z�Z��
�2�8�}�}����b�h�q�k�R�X�a�[�8�8��1�2�2�2�
�(�-�C�
�!�!�!�c��&;�&;��#�#�#����3���B��C�C����3���B��C��5�+�b�!�"4�"4�K��Y���.�.�E�D��}�������n�n�b��3�3�3���r�
�1�
�"�)�)�%�*�5�5���|���"�N�	�	����D�>�>�	N��I�I�
�U�]�]�0�0�I�I�
�U�]�]�1�1�I�I�
�U�]�]�1�1�I�I�
�U�]�]�0�0�I�I��M�N�N�
N��T�)�R�u�+��!�!�!�F��"�:�D��a�x�x���"�F�D�5�M�M�+�+�	+�	
���!��q��	 �	 ��N�O�O�O�	
���!��q��	 �	 ��N�O�O�O�	
�����K�L�L�L�
��{�{��a�y�&��*�$�$��a�y�&��*�f�Q�i�/�/r#)	�b�h�Brr�frrr)rrrOrrrrOrrrc��d}d}|D]D}|jj}t|t|��}t|t|��}�Et
||S)Nr)r;r<�max�_array_kind�_array_precision�_array_type)�arrays�kind�	precisionrC�ts     r!�_commonTyperY�s^���D��I�
�8�8��
�G�L���4��Q��(�(���	�#3�A�#6�7�7�	�	��t��Y�'�'r#c���d}|D]D}|jj|kr||���fz}�+||�|��fz}�Et	|��dkr|dS|S)Nrrr)r;r<�copyr>r9)�typerU�cast_arraysrCs    r!�	_castCopyr^�sw���K�
�:�:���7�<�4���%�������3�K�K�%����$���(9�9�K�K�
�;���1����1�~���r#c	�<�|rtt||f��\}}ntt||f��\}}t||g��D]T\}}|jdks|jd|jdkr(t
d�d|������U|jd|jdkr-t
d�|j|j�����|jd}t||tdgd����}t|||��\}}t|dz
dd	��D�]�}t|||dz
f��tt||dz
|dz
f��t|||f��zzk�rut||dz
|dz�|dz
|dz�f��|||fz
}t|d|||dz
fg��}	|d|	z}
|||dz
f|	z}t|
���|g||
gg|�
��}|�||dz
|dz�|dz
d�f��||dz
|dz�|dz
d�f<|d|dz�|dz
|dz�f�|���j��|d|dz�|dz
|dz�f<|dd�|dz
|dz�f�|���j��|dd�|dz
|dz�f<d|||dz
f<���||fS)
aQ
    Convert real Schur form to complex Schur form.

    Convert a quasi-diagonal real-valued Schur form to the upper-triangular
    complex-valued Schur form.

    Parameters
    ----------
    T : (M, M) array_like
        Real Schur form of the original array
    Z : (M, M) array_like
        Schur transformation matrix
    check_finite : bool, optional
        Whether to check that the input arrays contain only finite numbers.
        Disabling may give a performance gain, but may result in problems
        (crashes, non-termination) if the inputs do contain infinities or NaNs.

    Returns
    -------
    T : (M, M) ndarray
        Complex Schur form of the original array
    Z : (M, M) ndarray
        Schur transformation matrix corresponding to the complex form

    See Also
    --------
    schur : Schur decomposition of an array

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.linalg import schur, rsf2csf
    >>> A = np.array([[0, 2, 2], [0, 1, 2], [1, 0, 1]])
    >>> T, Z = schur(A)
    >>> T
    array([[ 2.65896708,  1.42440458, -1.92933439],
           [ 0.        , -0.32948354, -0.49063704],
           [ 0.        ,  1.31178921, -0.32948354]])
    >>> Z
    array([[0.72711591, -0.60156188, 0.33079564],
           [0.52839428, 0.79801892, 0.28976765],
           [0.43829436, 0.03590414, -0.89811411]])
    >>> T2 , Z2 = rsf2csf(T, Z)
    >>> T2
    array([[2.65896708+0.j, -1.64592781+0.743164187j, -1.21516887+1.00660462j],
           [0.+0.j , -0.32948354+8.02254558e-01j, -0.82115218-2.77555756e-17j],
           [0.+0.j , 0.+0.j, -0.32948354-0.802254558j]])
    >>> Z2
    array([[0.72711591+0.j,  0.28220393-0.31385693j,  0.51319638-0.17258824j],
           [0.52839428+0.j,  0.24720268+0.41635578j, -0.68079517-0.15118243j],
           [0.43829436+0.j, -0.76618703+0.01873251j, -0.03063006+0.46857912j]])

    rrrzInput '{}' must be square.�ZTz.Input array shapes must match: Z: {} vs. T: {}g@rr)r;Nr*)�maprr�	enumerate�ndimr:r8rBrYrr^�ranger2�epsrr�conj�dot�T)
rh�ZrF�ind�X�NrX�m�murr�s�Gs
             r!rr�sF��l�$��$�q�!�f�-�-���1�1��7�Q��F�#�#���1��Q��F�#�#�M�M���Q��6�Q�;�;�!�'�!�*����
�2�2��9�@�@��c��K�K�L�L�L�3�	�w�q�z�Q�W�Q�Z�����"�F�1�7�A�G�4�4�6�6�	6�	���
�A��A�q�%���s�+�+�,�,�A��Q��1���D�A�q�
�1�Q�3��2�
�
�����q��A�a�C��y�>�>�C��Q�q��s�A�a�C�x�[�!1�!1�C��!�Q�$��L�L�!@�A�A�A���1�Q�3�q��s�7�A�a�C��!��G�+�,�-�-��!�Q�$��7�B��b��e�Q�q�!�A�#�v�Y�'�(�(�A��1���	�A��!�Q�q�S�&�	�A�
�A�������!�}��r�1�g�.�a�8�8�8�A� �u�u�Q�q��s�1�Q�3�w��!����}�%5�6�6�A�a��c�!�A�#�g�q��s�t�t�m�� ��!�A�#��q��s�1�Q�3�w��/�3�3�A�F�F�H�H�J�?�?�A�d�q��s�d�A�a�C��!��G�m���a�a�a��1��Q�q�S��j�M�-�-�a�f�f�h�h�j�9�9�A�a�a�a��1��Q�q�S��j�M���!�Q�q�S�&�	�	��a�4�Kr#)rNFNT)T)�__doc__r?rrrr�numpy.linalgr�_miscr	r
�lapackr�_decompr�__all__r=r
�finfo�floatre�fepsrRrSrTrYr^rrr#r!�<module>rzss��$�$�����;�;�;�;�;�;�;�;�;�;�;�;�������,�+�+�+�+�+�+�+�$�$�$�$�$�$��������I�
��#�O�O��AE��_0�_0�_0�_0�D�e�k�%������u�{�6������A�A�A�A��A�A�A�/�/��������C�C���S�z�C��:�&��(�(�(�
�
�
�S�S�S�S�S�Sr#

Youez - 2016 - github.com/yon3zu
LinuXploit