403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.206
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
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-310.pyc
o

��Eb=-�@s�dZdgZddlZddlmZddlmZddlm	Z	ddl
mZdd	l
mZdd
l
m
Z
ddl
mZejeje
jejd�Zejeje
jejd�Zd
dd�ZGdd�d�Z				ddd�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@s8eZdZdZdd�Zdd�Zedd��Zedd	��Zd
S)�_AProdz�
    Wrapper class for linear operator

    The call signature of the __call__ method matches the callback of
    the PROPACK routines.
    cCs6zt|�|_WdStytt�|��|_YdSw�N)r�A�	TypeError�np�asarray)�selfr�r�;/usr/lib/python3/dist-packages/scipy/sparse/linalg/_svdp.py�__init__:s
�z_AProd.__init__cCs8|dkr|j�|�|dd�<dS|j�|�|dd�<dS)N�n)r�matvec�rmatvec)r�transa�mr�x�y�sparm�iparmrrr�__call__@sz_AProd.__call__cCs|jjSr)r�shape�rrrrr'Fsz_AProd.shapec	Cs:z|jjWSty|j�t�|jjd��jYSw)Nr)r�dtype�AttributeErrorrr�zerosr'r(rrrr)Js

 �z_AProd.dtypeN)	�__name__�
__module__�__qualname__�__doc__rr&�propertyr'r)rrrrr3s
rrTF���Mb`?c+
Cs�t�|�rt�d�jdkrtd��t|�}|��}|dvr!td��|s+|dkr+td��t|�}|j	j
}z
t|}t|}Wn(t
yet�tjd|d��rUt�	t�j
}nt�	t�j
}t|}t|}Ynw|j\}}|d	ksv|t||�krztd
��|dur�d|}|dur�d
}t|d	|d	|�}||kr�td|�d|�d���|r�dnd}|r�dnd}tj||d	fd|d�}tj||fd|d�}|dur�|j|d�|dd�df<t�tjd|d��r�|dd�dfd|j|d�7<nz
||dd�df<Wnt�y	td|����w|
du�rt�t�|�j�}
|du�r%t�|�jd}|�rWtj|
|||f|��d�}|du�r>||}|t||||�k�rMtd��|dk�rVtd��ntj|
||f|��d�}tjtt|
��tt|��fdd�}d}|�s||�r�||d|d||dtd ||d|d|t||��} d|}!n!||d|d!||dt||d|d�} d!|d	}!tj| |��d�}"tj|!tjd�}#tjd	|��d�}$tjd	tjd�}%|���rtj||d"||d�}&|"|&|#f}'n|"|#f}'|�r*|t||||||||||||	g|'�|�|�|$�|%�R�\}}(})}}*n||||||||||	g	|'�|�|�|$�|%�R�\}}(})}}*|*dk�rTt d#|*�d$���|*dk�rdt d%|�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#rr
)�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'�minr+�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�inforrrrRs�a�
	���$��



�"	 �
6

�����������

�
��2)rTNTTNFrNNrFTr1NNN)r/�__all__�numpyr�scipy._lib._utilr�scipy.sparse.linalgr�scipy.linalgr�_propackrrr	r
�slansvd�dlansvd�clansvd�zlansvdrF�slansvd_irl�dlansvd_irl�clansvd_irl�zlansvd_irlrErWrrrrrr�<module>s:�	���

Youez - 2016 - github.com/yon3zu
LinuXploit