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_cossin.cpython-311.pyc
�

d�c�#��X�ddlmZddlZddlmZddlmZmZddl	m
Z
mZdgZ		dd
�Z
dS)�)�IterableN)�_asarray_validated)�
block_diag�LinAlgError�)�_compute_lwork�get_lapack_funcs�cossinFTc�H�|s|�r/|�dnt|��}|�dnt|��}t|d���}tj|j�s'td�|j�����|jd}||ks|dkr.td�||jd�����||ks|dkr.td�||jd�����|d|�d|�f|d|�|d�f||d�d|�f||d�|d�ff\}}	}
}�n�t|t��std	���t|��d
kr/td�t|�������d�|D��\}}	}
}tgd
�||	|
|g��D]8\}}
|
jddkr"td�|������9|j\}}|j\}}|	j||fkr*td�||f|	j�����|
j||fkr*td�||f|
j�����||z||zkr)td�||z||z�����||z}td�||	|
|fD����}|rdnd}t||dzg||	|
|g��\}}t||||���}|r|d|dd�nd|i}|d||	|
|||||d|d�
|���^}}}}}}}|j|z}|dkr$td�||�����|dkr#td�||�����|r	||f|||ffSt!||��}t!||��}tjtj|����} tjtj|����}!t)||||z
||z
��}"t)||��|"z
}#t)|||z
��|"z
}$t)||z
|��|"z
}%t)||z
||z
��|"z
}&tjtj|#|$|%|&|"g��|j���}'tj||f|j���}(|'d|#�d|#�f|(d|#�d|#�f<|#|"z})|#|"z|$z}*|#|%z|&zd|"zz}+|#|%z|&zd|"zz|$z},|r|'d|$�d|$�fn|'d|$�d|$�f|(|)|*�|+|,�f<||&z|"z})||&z|"z|%
z}*|#|"z}+|#|"z|%z},|r|'d|%�d|%�fn
|'d|%�d|%�f|(|)|*�|+|,�f<|'d|&�d|&�f|(|||&z�|||&z�f<| |(|#|#|"z�|#|#|"z�f<| |(||&z||&z|"z�|"|%z|&zd|"z|%z|&z�f<|#})|#|"z}*|#|%z|&z|"z}+|#|%z|&zd|"zz},|r|!n|!|(|)|*�|+|,�f<|r|!n|!|(||&z||&z|"z�|#|#|"z�f<||(|fS) u�
    Compute the cosine-sine (CS) decomposition of an orthogonal/unitary matrix.

    X is an ``(m, m)`` orthogonal/unitary matrix, partitioned as the following
    where upper left block has the shape of ``(p, q)``::

                                   ┌                   ┐
                                   │ I  0  0 │ 0  0  0 │
        ┌           ┐   ┌         ┐│ 0  C  0 │ 0 -S  0 │┌         ┐*
        │ X11 │ X12 │   │ U1 │    ││ 0  0  0 │ 0  0 -I ││ V1 │    │
        │ ────┼──── │ = │────┼────││─────────┼─────────││────┼────│
        │ X21 │ X22 │   │    │ U2 ││ 0  0  0 │ I  0  0 ││    │ V2 │
        └           ┘   └         ┘│ 0  S  0 │ 0  C  0 │└         ┘
                                   │ 0  0  I │ 0  0  0 │
                                   └                   ┘

    ``U1``, ``U2``, ``V1``, ``V2`` are square orthogonal/unitary matrices of
    dimensions ``(p,p)``, ``(m-p,m-p)``, ``(q,q)``, and ``(m-q,m-q)``
    respectively, and ``C`` and ``S`` are ``(r, r)`` nonnegative diagonal
    matrices satisfying ``C^2 + S^2 = I`` where ``r = min(p, m-p, q, m-q)``.

    Moreover, the rank of the identity matrices are ``min(p, q) - r``,
    ``min(p, m - q) - r``, ``min(m - p, q) - r``, and ``min(m - p, m - q) - r``
    respectively.

    X can be supplied either by itself and block specifications p, q or its
    subblocks in an iterable from which the shapes would be derived. See the
    examples below.

    Parameters
    ----------
    X : array_like, iterable
        complex unitary or real orthogonal matrix to be decomposed, or iterable
        of subblocks ``X11``, ``X12``, ``X21``, ``X22``, when ``p``, ``q`` are
        omitted.
    p : int, optional
        Number of rows of the upper left block ``X11``, used only when X is
        given as an array.
    q : int, optional
        Number of columns of the upper left block ``X11``, used only when X is
        given as an array.
    separate : bool, optional
        if ``True``, the low level components are returned instead of the
        matrix factors, i.e. ``(u1,u2)``, ``theta``, ``(v1h,v2h)`` instead of
        ``u``, ``cs``, ``vh``.
    swap_sign : bool, optional
        if ``True``, the ``-S``, ``-I`` block will be the bottom left,
        otherwise (by default) they will be in the upper right block.
    compute_u : bool, optional
        if ``False``, ``u`` won't be computed and an empty array is returned.
    compute_vh : bool, optional
        if ``False``, ``vh`` won't be computed and an empty array is returned.

    Returns
    -------
    u : ndarray
        When ``compute_u=True``, contains the block diagonal orthogonal/unitary
        matrix consisting of the blocks ``U1`` (``p`` x ``p``) and ``U2``
        (``m-p`` x ``m-p``) orthogonal/unitary matrices. If ``separate=True``,
        this contains the tuple of ``(U1, U2)``.
    cs : ndarray
        The cosine-sine factor with the structure described above.
         If ``separate=True``, this contains the ``theta`` array containing the
         angles in radians.
    vh : ndarray
        When ``compute_vh=True`, contains the block diagonal orthogonal/unitary
        matrix consisting of the blocks ``V1H`` (``q`` x ``q``) and ``V2H``
        (``m-q`` x ``m-q``) orthogonal/unitary matrices. If ``separate=True``,
        this contains the tuple of ``(V1H, V2H)``.

    References
    ----------
    .. [1] Brian D. Sutton. Computing the complete CS decomposition. Numer.
           Algorithms, 50(1):33-65, 2009.

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.linalg import cossin
    >>> from scipy.stats import unitary_group
    >>> x = unitary_group.rvs(4)
    >>> u, cs, vdh = cossin(x, p=2, q=2)
    >>> np.allclose(x, u @ cs @ vdh)
    True

    Same can be entered via subblocks without the need of ``p`` and ``q``. Also
    let's skip the computation of ``u``

    >>> ue, cs, vdh = cossin((x[:2, :2], x[:2, 2:], x[2:, :2], x[2:, 2:]),
    ...                      compute_u=False)
    >>> print(ue)
    []
    >>> np.allclose(x, u @ cs @ vdh)
    True

    NrT)�check_finitez?Cosine Sine decomposition only supports square matrices, got {}rzinvalid p={}, 0<p<{} must holdzinvalid q={}, 0<q<{} must holdzJWhen p and q are None, X must be an Iterable containing the subblocks of X�zAWhen p and q are None, exactly four arrays should be in X, got {}c�6�g|]}tj|����S�)�np�
atleast_2d��.0�xs  �=/usr/lib/python3/dist-packages/scipy/linalg/_decomp_cossin.py�
<listcomp>zcossin.<locals>.<listcomp>�s"��:�:�:�1�b�m�A�.�.�:�:�:�)�x11�x12�x21�x22z{} can't be emptyz*Invalid x12 dimensions: desired {}, got {}z*Invalid x21 dimensions: desired {}, got {}z�The subblocks have compatible sizes but don't form a square array (instead they form a {}x{} array). This might be due to missing p, q arguments.c�6�g|]}tj|����Sr)r�iscomplexobjrs  rrzcossin.<locals>.<listcomp>�s"��A�A�A�q����"�"�A�A�Ar�uncsd�orcsd�_lwork)�m�p�q)�lwork�lrworkr$F)
rrrr�
compute_u1�
compute_u2�compute_v1t�compute_v2t�trans�signsz+illegal value in argument {} of internal {}z{} did not converge: {})�dtype�r)�intrr�equal�shape�
ValueError�format�
isinstancer�len�zip�anyr	r�typecoderr�diag�cos�sin�min�eye�maxr,�zeros)-�Xr"r#�separate�	swap_sign�	compute_u�
compute_vhr!rrrr�name�block�mmp�mmq�cplx�driver�csd�	csd_lworkr$�
lwork_args�_�theta�u1�u2�v1h�v2h�info�method_name�U�VDH�c�s�r�n11�n12�n21�n22�Id�CS�xs�xe�ys�yes-                                             rr
r
s���F	�.�A�.���A�A��A������A�A��A�����q�t�4�4�4���x���!�	B��1�17������B�B�
B�
�G�A�J����6�6�Q�!�V�V��=�$�f�Q����
�3�3�5�5�
5���6�6�Q�!�V�V��=�$�f�Q����
�3�3�5�5�
5��r��r�2�A�2�v�Y��"�1�"�a�b�b�&�	�1�Q�R�R��!��V�9�a����A�B�B��i�G���S�#�s�s�
��8�
$�
$���:�;�;�	;��q�6�6�Q�;�;��7�7=�v�c�!�f�f�~�~�G�G�
G�;�:��:�:�:���S�#�s��;�;�;� #�S�#�s�3�5�5�	C�	C�K�D�%��{�1�~��"�"� �!4�!;�!;�D�!A�!A�B�B�B�#��y���1��9���S��9��C�� � ��&�&,�f�a��X�s�y�&A�&A�C�C�
C��9��a�� � ��&�&,�f�c�1�X�s�y�&A�&A�C�C�
C�
�s�7�a�#�g����/�06�v�a�#�g�q�3�w�/G�/G�I�I�
I�

��G���A�A�S�#�s�C�,@�A�A�A�B�B�D��
)�W�W�'�F�%�v�v��/@�&A�'*�C��c�&:�<�<�N�C���9��Q�!�4�4�4�E�=A�#�E�!�H��a��9�9�9��E�"��(+��):���#�3�7@�7@�8B�8B�27�y�):�):�/9�
):�):�%�Q��r�2�s�C���,��'�K��a�x�x��F� �&�$���4�4�6�6�	6��a�x�x��3�:�:�;��M�M�N�N�N��+��B�x���c�
�*�*��2�r���A�
�S�#�
�
�C�	����u�
�
���A�
����u�
�
���A��A�q�!�a�%��Q����A�

�a��)�)�a�-�C�

�a��Q��-�-�!�
�C�

�a�!�e�Q�-�-�!�
�C�

�a�!�e�Q��U�
�
�a�
�C�	�����S�#�s�A�.�/�/�u�{�	C�	C�	C�B�	��1�a�&���	,�	,�	,�B�����d�s�d�
�^�B�t��t�T�c�T�z�N�	�q��B�	�q��3��B�	�s��S��1�q�5�	 �B�	�s��S��1�q�5�	 �3�	&�B�*3�H��4�C�4��#��:���"�T�c�T�4�C�4�Z�.��B�r�2�v�r�"�u�}��	
�S��1��B�	
�S��1���u�	�B�	�q��B�	�q��3��B�*3�G��4�C�4��#��:�����D�S�D�$�3�$�J��B�r�"�u�b��e�|��!�$�3�$����*�~�B�q��S��y�!�A��G�)���#$�B�s�3��7�{�C��a��K�� �?@�B�q�3�w�q�3�w��{��A��G�c�M�!�a�%�#�+��*;�;�;�<�	�B�	�q��B�	�s��S��1�	�B�	�s��S��1�q�5�	 �B�%�-�q�q�A�2�B�r�"�u�b��e�|��1:�+A�A�2�2��B�q�3�w�q�3�w��{��C��a��K�'�(��b�#�:�r)NNFFTT)�collections.abcr�numpyr�scipy._lib._utilr�scipy.linalgrr�lapackrr	�__all__r
rrr�<module>rjs���$�$�$�$�$�$�����/�/�/�/�/�/�0�0�0�0�0�0�0�0�4�4�4�4�4�4�4�4��*��(-�7;�T�T�T�T�T�Tr

Youez - 2016 - github.com/yon3zu
LinuXploit