관리-도구
편집 파일: linalg.cpython-37.pyc
B ��Fd. � @ s4 d Z ddlmZmZmZ ddddddd d ddd ddddddddddgZddlZddlmZm Z m Z mZmZm Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8m9Z9 ddl:m;Z; dZ<dZ=d Z>d!Z?d"Z@eZAG d#d� deB�ZCdaDd$d%� ZEeE� d&d'� ZFd(d)� ZGd*d+� ZHd,d-� ZId.d/� ZJd0d1� ZKd2d3� ZLeeeeeeeeiZMeeeeeeeeiZNefd4d5�ZOefd6d7�ZPd8d9� ZQeeeeeeeeiZNd:d;� ZReZSd<d=� ZTd>d?� ZUd@dA� ZVdBdC� ZWdDdE� ZXdFdG� ZYdHdI� ZZdJdK� Z[dLdM� Z\drdNd�Z]dOd� Z^dsdQd�Z_dRd� Z`dSd� ZadtdUd�ZbdVd � ZcdudXd �ZddYdZ� Zed[d� Zfdvd\d�Zgdwd^d�Zhdxd_d�Zidyd`d�Zjdzdbd�Zkdcd� Zlddd � Zmd{dfd�Zndgdh� Zod|djd�Zpdkd� Zqdldm� Zrd}dndo�Zsdpdq� ZtdS )~ax Lite version of scipy.linalg. Notes ----- This module is a lite version of the linalg.py module in SciPy which contains high-level Python interface to the LAPACK library. The lite version only accesses the following LAPACK functions: dgesv, zgesv, dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetrf, zgetrf, dpotrf, zpotrf, dgeqrf, zgeqrf, zungqr, dorgqr. � )�division�absolute_import�print_function�matrix_power�solve�tensorsolve� tensorinv�inv�cholesky�eigvals�eigvalsh�pinv�slogdet�det�svd�eig�eigh�lstsq�norm�qr�cond�matrix_rank�LinAlgError� multi_dotN)*�array�asarray�zeros�empty� empty_like� transpose�intc�single�double�csingle�cdouble�inexact�complexfloating�newaxis�ravel�all�Inf�dot�add�multiply�sqrt�maximum�fastCopyAndTranspose�sum�isfinite�size�finfo�errstate� geterrobj� longdouble�rollaxis�amin�amax�product�abs� broadcast� atleast_2d�intp� asanyarray�isscalar�object_�ones)�normalize_axis_index)�triu�asfarray)�lapack_lite� _umath_linalg)r � N� V� A� S� Lc @ s e Zd ZdZdS )r a Generic Python-exception-derived object raised by linalg functions. General purpose exception class, derived from Python's exception.Exception class, programmatically raised in linalg functions when a Linear Algebra-related condition would prevent further correct execution of the function. Parameters ---------- None Examples -------- >>> from numpy import linalg as LA >>> LA.inv(np.zeros((2,2))) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "...linalg.py", line 350, in inv return wrap(solve(a, identity(a.shape[0], dtype=a.dtype))) File "...linalg.py", line 249, in solve raise LinAlgError('Singular matrix') numpy.linalg.LinAlgError: Singular matrix N)�__name__� __module__�__qualname__�__doc__� rR rR �F/opt/alt/python37/lib64/python3.7/site-packages/numpy/linalg/linalg.pyr + s c C sB t � } | d }tddddd�� t � d }W d Q R X ||d gad S )Nr �call�ignore)�invalidZover�divideZunder� )r6 r5 �_linalg_error_extobj)Zerrobj�bufsizeZinvalid_call_errmaskrR rR rS �_determine_error_statesL s r[ c C s t d��d S )NzSingular matrix)r )�err�flagrR rR rS �_raise_linalgerror_singularY s r^ c C s t d��d S )NzMatrix is not positive definite)r )r\ r] rR rR rS �_raise_linalgerror_nonposdef\ s r_ c C s t d��d S )NzEigenvalues did not converge)r )r\ r] rR rR rS �-_raise_linalgerror_eigenvalues_nonconvergence_ s r` c C s t d��d S )NzSVD did not converge)r )r\ r] rR rR rS �%_raise_linalgerror_svd_nonconvergenceb s ra c C s t t�}| |d<