| 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 : |
�
d�c. � �v � d Z ddlmZmZmZ ddlmZmZ ddlm Z g d�Z
dd �Zdd
�Zdd�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 |� � }|j dk r't d� |j � � � � �|j d |j d k r't d� |j � � � � �|j dk r|� � � |fS |pt || � � }t d|f� � \ } |||||�� � \ }}|dk rt d|z � � �|dk r#t d � | � � � � �||fS )
z,Common code for cholesky() and cho_factor().� z4Input array needs to be 2D but received a {}d-array.r r z;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".)r r r �ndim�
ValueError�format�shape�size�copyr r r ) �ar r r �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�r r r r �r! �r r r r r s r r
r
- s- � �X ��%�[��&2�4� 4� 4�H�A�u��Hr"