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

d�c.��v�dZddlmZmZmZddlmZmZddlm	Z	gd�Z
		dd	�Zdd
�Zdd�Z
dd�Zdd
�Zdd�ZdS)z!Cholesky decomposition functions.�)�asarray_chkfinite�asarray�
atleast_2d�)�LinAlgError�_datacopied)�get_lapack_funcs)�cholesky�
cho_factor�	cho_solve�cholesky_banded�cho_solve_bandedFTc��|rt|��nt|��}t|��}|jdkr't	d�|j�����|jd|jdkr't	d�|j�����|jdkr|���|fS|pt||��}td|f��\}|||||���\}}|dkrtd|z���|dkr#t	d	�|�����||fS)
z,Common code for cholesky() and cho_factor().�z4Input array needs to be 2D but received a {}d-array.rrz;Input array is expected to be square but has the shape: {}.)�potrf)�lower�overwrite_a�cleanz9%d-th leading minor of the array is not positive definitezFLAPACK reported an illegal value in {}-th argumenton entry to "POTRF".)rrr�ndim�
ValueError�format�shape�size�copyrr	r)	�arrr�check_finite�a1r�c�infos	         �?/usr/lib/python3/dist-packages/scipy/linalg/_decomp_cholesky.py�	_choleskyr!
s^��".�	=�	�1�	�	�	�7�1�:�:�B�	�B���B�
�w�!�|�|��(�(.��r�w���9�9�	9�
�x��{�b�h�q�k�!�!��*�*0�&���*:�*:�<�<�	<�
�w�!�|�|��w�w�y�y�%����3��R��!3�!3�K�
�j�2�%�
0�
0�F�E��e�B�e��E�J�J�J�G�A�t��a�x�x��%�'+�,�-�-�	-��a�x�x��0�06���u�
�
�?�?�	?��e�8�O�c�4�t|||d|���\}}|S)a	
    Compute the Cholesky decomposition of a matrix.

    Returns the Cholesky decomposition, :math:`A = L L^*` or
    :math:`A = U^* U` of a Hermitian positive-definite matrix A.

    Parameters
    ----------
    a : (M, M) array_like
        Matrix to be decomposed
    lower : bool, optional
        Whether to compute the upper- or lower-triangular Cholesky
        factorization.  Default is upper-triangular.
    overwrite_a : bool, optional
        Whether to overwrite data in `a` (may improve performance).
    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
    -------
    c : (M, M) ndarray
        Upper- or lower-triangular Cholesky factor of `a`.

    Raises
    ------
    LinAlgError : if decomposition fails.

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.linalg import cholesky
    >>> a = np.array([[1,-2j],[2j,5]])
    >>> L = cholesky(a, lower=True)
    >>> L
    array([[ 1.+0.j,  0.+0.j],
           [ 0.+2.j,  1.+0.j]])
    >>> L @ L.T.conj()
    array([[ 1.+0.j,  0.-2.j],
           [ 0.+2.j,  5.+0.j]])

    T�rrrr�r!�rrrrrs     r r
r
-s-��X��%�[��&2�4�4�4�H�A�u��Hr"c�8�t|||d|���\}}||fS)a\
    Compute the Cholesky decomposition of a matrix, to use in cho_solve

    Returns a matrix containing the Cholesky decomposition,
    ``A = L L*`` or ``A = U* U`` of a Hermitian positive-definite matrix `a`.
    The return value can be directly used as the first parameter to cho_solve.

    .. warning::
        The returned matrix also contains random data in the entries not
        used by the Cholesky decomposition. If you need to zero these
        entries, use the function `cholesky` instead.

    Parameters
    ----------
    a : (M, M) array_like
        Matrix to be decomposed
    lower : bool, optional
        Whether to compute the upper or lower triangular Cholesky factorization
        (Default: upper-triangular)
    overwrite_a : bool, optional
        Whether to overwrite data in a (may improve performance)
    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
    -------
    c : (M, M) ndarray
        Matrix whose upper or lower triangle contains the Cholesky factor
        of `a`. Other parts of the matrix contain random data.
    lower : bool
        Flag indicating whether the factor is in the lower or upper triangle

    Raises
    ------
    LinAlgError
        Raised if decomposition fails.

    See Also
    --------
    cho_solve : Solve a linear set equations using the Cholesky factorization
                of a matrix.

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.linalg import cho_factor
    >>> A = np.array([[9, 3, 1, 5], [3, 7, 5, 1], [1, 5, 9, 2], [5, 1, 2, 6]])
    >>> c, low = cho_factor(A)
    >>> c
    array([[3.        , 1.        , 0.33333333, 1.66666667],
           [3.        , 2.44948974, 1.90515869, -0.27216553],
           [1.        , 5.        , 2.29330749, 0.8559528 ],
           [5.        , 1.        , 2.        , 1.55418563]])
    >>> np.allclose(np.triu(c).T @ np. triu(c) - A, np.zeros((4, 4)))
    True

    Fr$r%r&s     r rr^s1��x��%�[��&2�4�4�4�H�A�u��e�8�Or"c�.�|\}}|rt|��}t|��}nt|��}t|��}|jdks|jd|jdkrt	d���|jd|jdkr-t	d�|j|j�����|pt
||��}td||f��\}|||||���\}}	|	dkrt	d|	z���|S)	aMSolve the linear equations A x = b, given the Cholesky factorization of A.

    Parameters
    ----------
    (c, lower) : tuple, (array, bool)
        Cholesky factorization of a, as given by cho_factor
    b : array
        Right-hand side
    overwrite_b : bool, optional
        Whether to overwrite data in b (may improve performance)
    check_finite : bool, optional
        Whether to check that the input matrices 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
    -------
    x : array
        The solution to the system A x = b

    See Also
    --------
    cho_factor : Cholesky factorization of a matrix

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.linalg import cho_factor, cho_solve
    >>> A = np.array([[9, 3, 1, 5], [3, 7, 5, 1], [1, 5, 9, 2], [5, 1, 2, 6]])
    >>> c, low = cho_factor(A)
    >>> x = cho_solve((c, low), [1, 1, 1, 1])
    >>> np.allclose(A @ x - [1, 1, 1, 1], np.zeros(4))
    True

    rrrz$The factored matrix c is not square.z#incompatible dimensions ({} and {}))�potrs�r�overwrite_bz0illegal value in %dth argument of internal potrs)rrrrrrrr	)
�c_and_lower�br+rrr�b1r)�xrs
          r rr�s+��H�J�Q����
�q�
!�
!���a� � ���
�Q�Z�Z���A�J�J���v��{�{�a�g�a�j�A�G�A�J�.�.��?�@�@�@��w�q�z�R�X�a�[� � ��>� �&���"�(�3�3�5�5�	5��3��R��!3�!3�K�
�j�1�b�'�
2�
2�F�E��e�A�r��K�@�@�@�G�A�t��q�y�y��K� �5�!�"�"�	"��Hr"c���|rt|��}nt|��}td|f��\}||||���\}}|dkrtd|z���|dkrt	d|z���|S)ai
    Cholesky decompose a banded Hermitian positive-definite matrix

    The matrix a is stored in ab either in lower-diagonal or upper-
    diagonal ordered form::

        ab[u + i - j, j] == a[i,j]        (if upper form; i <= j)
        ab[    i - j, j] == a[i,j]        (if lower form; i >= j)

    Example of ab (shape of a is (6,6), u=2)::

        upper form:
        *   *   a02 a13 a24 a35
        *   a01 a12 a23 a34 a45
        a00 a11 a22 a33 a44 a55

        lower form:
        a00 a11 a22 a33 a44 a55
        a10 a21 a32 a43 a54 *
        a20 a31 a42 a53 *   *

    Parameters
    ----------
    ab : (u + 1, M) array_like
        Banded matrix
    overwrite_ab : bool, optional
        Discard data in ab (may enhance performance)
    lower : bool, optional
        Is the matrix in the lower form. (Default is upper form)
    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
    -------
    c : (u + 1, M) ndarray
        Cholesky factorization of a, in the same banded format as ab

    See Also
    --------
    cho_solve_banded :
        Solve a linear set equations, given the Cholesky factorization
        of a banded Hermitian.

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.linalg import cholesky_banded
    >>> from numpy import allclose, zeros, diag
    >>> Ab = np.array([[0, 0, 1j, 2, 3j], [0, -1, -2, 3, 4], [9, 8, 7, 6, 9]])
    >>> A = np.diag(Ab[0,2:], k=2) + np.diag(Ab[1,1:], k=1)
    >>> A = A + A.conj().T + np.diag(Ab[2, :])
    >>> c = cholesky_banded(Ab)
    >>> C = np.diag(c[0, 2:], k=2) + np.diag(c[1, 1:], k=1) + np.diag(c[2, :])
    >>> np.allclose(C.conj().T @ C - A, np.zeros((5, 5)))
    True

    )�pbtrf)r�overwrite_abrz)%d-th leading minor not positive definitez1illegal value in %d-th argument of internal pbtrf)rrr	rr)�abr2rrr1rrs       r r
r
�s���x��
�r�
"�
"���
�R�[�[��
�j�2�%�
0�
0�F�E��e�B�e�,�?�?�?�G�A�t��a�x�x��E��L�M�M�M��a�x�x��L� �5�!�"�"�	"��Hr"c��|\}}|rt|��}t|��}nt|��}t|��}|jd|jdkrtd���t	d||f��\}|||||���\}}|dkrtd|z���|dkrtd|z���|S)a�
    Solve the linear equations ``A x = b``, given the Cholesky factorization of
    the banded Hermitian ``A``.

    Parameters
    ----------
    (cb, lower) : tuple, (ndarray, bool)
        `cb` is the Cholesky factorization of A, as given by cholesky_banded.
        `lower` must be the same value that was given to cholesky_banded.
    b : array_like
        Right-hand side
    overwrite_b : bool, optional
        If True, the function will overwrite the values in `b`.
    check_finite : bool, optional
        Whether to check that the input matrices 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
    -------
    x : array
        The solution to the system A x = b

    See Also
    --------
    cholesky_banded : Cholesky factorization of a banded matrix

    Notes
    -----

    .. versionadded:: 0.8.0

    Examples
    --------
    >>> import numpy as np
    >>> from scipy.linalg import cholesky_banded, cho_solve_banded
    >>> Ab = np.array([[0, 0, 1j, 2, 3j], [0, -1, -2, 3, 4], [9, 8, 7, 6, 9]])
    >>> A = np.diag(Ab[0,2:], k=2) + np.diag(Ab[1,1:], k=1)
    >>> A = A + A.conj().T + np.diag(Ab[2, :])
    >>> c = cholesky_banded(Ab)
    >>> x = cho_solve_banded((c, False), np.ones(5))
    >>> np.allclose(A @ x - np.ones(5), np.zeros(5))
    True

    ���rz&shapes of cb and b are not compatible.)�pbtrsr*z(%dth leading minor not positive definitez0illegal value in %dth argument of internal pbtrs)rrrrr	r)	�cb_and_lowerr-r+r�cbrr6r/rs	         r rr%s���\�K�R����
�r�
"�
"���a� � ���
�R�[�[���A�J�J��
�x��|�q�w�q�z�!�!��A�B�B�B�
�j�2�q�'�
2�
2�F�E��e�B���K�@�@�@�G�A�t��a�x�x��D�t�K�L�L�L��a�x�x��K� �5�!�"�"�	"��Hr"N)FFTT)FFT)FT)�__doc__�numpyrrr�_miscrr�lapackr	�__all__r!r
rrr
r�r"r �<module>r?s���'�'�8�8�8�8�8�8�8�8�8�8�,�+�+�+�+�+�+�+�$�$�$�$�$�$�����8<������@.
�.
�.
�.
�b>�>�>�>�B8
�8
�8
�8
�vH
�H
�H
�H
�VA
�A
�A
�A
�A
�A
r"

Youez - 2016 - github.com/yon3zu
LinuXploit