| 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/_eigen/lobpcg/__pycache__/ |
Upload File : |
�
d�cݑ � � � d Z ddlZddlZddlmZmZmZmZm Z m
Z
ddlmZ ddl
mZ ddlmZ dgZd� Zd � Zd
� Zd� Z dd�Zd
� Zd� Z dd�ZdS )a�
Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG).
References
----------
.. [1] A. V. Knyazev (2001),
Toward the Optimal Preconditioned Eigensolver: Locally Optimal
Block Preconditioned Conjugate Gradient Method.
SIAM Journal on Scientific Computing 23, no. 2,
pp. 517-541. :doi:`10.1137/S1064827500366124`
.. [2] A. V. Knyazev, I. Lashuk, M. E. Argentati, and E. Ovchinnikov (2007),
Block Locally Optimal Preconditioned Eigenvalue Xolvers (BLOPEX)
in hypre and PETSc. :arxiv:`0705.2626`
.. [3] A. V. Knyazev's C and MATLAB implementations:
https://github.com/lobpcg/blopex
� N)�inv�eigh�
cho_factor� cho_solve�cholesky�LinAlgError)�LinearOperator)�
isspmatrix)�block�lobpcgc �J � ddl m} | | j � � � z
} ||d� � }dt j | j � � j z }t || || d� � z � � }||k r0t j
d|� d| j � d|� d|� d � t d
�� � dS dS )
zA
Report if `M` is not a Hermitian matrix given its type.
r )�norm� �
zMatrix z
of the type z is not Hermitian: condition: z < z fails.� ��
stacklevelN)�scipy.linalgr �T�conj�np�finfo�dtype�eps�max�warnings�warn�UserWarning)�M�namer �md�nmd�tols �J/usr/lib/python3/dist-packages/scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py�_report_nonhermitianr% s� � � "�!�!�!�!�!�
�Q�S�X�X�Z�Z��B�
�$�r�1�+�+�C�
�r�x��� � �$�
$�C�
�c�3���a����#�
$�
$�C�
�S�y�y��
�1�� 1� 1�1�7� 1� 1��1� 1�$'�1� 1� 1��a� � � � � � � �y� c �t � | j dk r| S t j | d�� � }| j d df|_ |S )zm
If the input array is 2D return it, if it is 1D, append a dimension,
making it a column vector.
� F)�copyr r )�ndimr �array�shape)�ar�auxs r$ �_as2dr/ 0 s? � �
�w�!�|�|�� ��h�r��&�&�&���X�a�[�!�$�� ��
r&