o
     ôj9R  ã                   @   sî  d dl mZ d dlmZ d dlmZ ddlmZmZm	Z	m
Z
mZmZ ddlmZ d ¡ Zdd	„ e ¡ D ƒZeefi d
dddddddddddddœ¤ŽZddddddœZdd„ e ¡ D ƒZd d„ e ¡ D ƒZG d!d"„ d"eeƒZeD ]Zeed#e› �e
ƒ qpeD ]Zeed#e› �e	ƒ q~i d$d%“d&d&“d'd'“d(d)“d*d+“d,d-“d.d/“d0d0“d1d1“d2d2“d3d3“d4d5“d6d7“d8d8“d9d:“d;d<“d=d>“d?d@dAdBdCdDdEdFdGœ¥ZdHddIœZdJd„ e ¡ D ƒZdKd„ e ¡ D ƒZG dLdM„ dMeƒZ eD ]Zee d#e› �e
ƒ qëeD ]Zee d#e› �e	ƒ qùdNd„ e ¡ D ƒZ!dOd„ e ¡ D ƒZ"G dPdQ„ dQeƒZ#e!D ]Zee#d#e› �e
ƒ �q!e"D ]Zee#d#e› �e	ƒ �q0dRd„ e ¡ D ƒZ$dSd„ e ¡ D ƒZ%G dTdU„ dUeƒZ&e$D ]Zee&d#e› �e
ƒ �qYe%D ]Zee&d#e› �e	ƒ �qhdVS )Wé    )ÚS)ÚLambda)ÚPowé   )ÚPythonCodePrinterÚ_known_functions_mathÚ_print_known_constÚ_print_known_funcÚ_unpack_integral_limitsÚArrayPrinter)ÚCodePrinterz!erf erfc factorial gamma loggammac                 C   s    g | ]\}}|t vr||f‘qS © )Ú_not_in_numpy©Ú.0ÚkÚvr   r   úg/var/www/html/academy/tools/voices/clone/cosy-venv/lib/python3.10/site-packages/sympy/printing/numpy.pyÚ
<listcomp>	   s     r   ÚarccosÚarccoshÚarcsinÚarcsinhÚarctanÚarctan2ÚarctanhÚexp2ÚsignÚ	logaddexpÚ
logaddexp2ÚisinfÚisnan)ÚacosÚacoshÚasinÚasinhÚatanÚatan2Úatanhr   r   r   r   r    r!   ÚeÚpiÚeuler_gammaÚnanÚinf)ÚExp1ÚPiÚ
EulerGammaÚNaNÚInfinityc                 C   ó   i | ]	\}}|d | “qS ©znumpy.r   r   r   r   r   Ú
<dictcomp>"   ó    r5   c                 C   r3   r4   r   r   r   r   r   r5   #   r6   c                       s–  e Zd ZdZdZeZeZdY‡ fdd„	Z	dd„ Z
dd	„ Zd
d„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd d!„ Zd"d#„ Zd$d%„ Zd&d'„ Z‡ fd(d)„Zd*d+„ Zd,d-„ Zd.d/„ ZdZd1d2„Zd3e fd4d5„Z!d6d7„ Z"d8d9„ Z#d:d;„ Z$d<d=„ Z%d>d?„ Z&d@dA„ Z'dBdC„ Z(dDdE„ Z)dFdG„ Z*dHdI„ Z+dJdK„ Z,dLdM„ Z-dNdO„ Z.dPdQ„ Z/dRdS„ Z0dTZ1dUZ2dVZ3dWZ4dXZ5e6j7Z8e6j7Z9e6j7Z:e6j7Z;‡  Z<S )[ÚNumPyPrinterza
    Numpy printer which handles vectorized piecewise functions,
    logical operators, etc.
    ÚnumpyNc                    s@   d  | j¡| _d  | j¡| _i tj¥| j¥| _tƒ j|d� dS )z 
        `settings` is passed to CodePrinter.__init__()
        `module` specifies the array module to use, currently 'NumPy', 'CuPy'
        or 'JAX'.
        zPython with {}z_{}code©ÚsettingsN)ÚformatÚ_moduleÚlanguageÚprintmethodr   Ú_kfÚsuperÚ__init__©Úselfr:   ©Ú	__class__r   r   rA   /   s   zNumPyPrinter.__init__c                    s"   d}d  | ‡ fdd„|D ƒ¡¡S )z+General sequence printer: converts to tupleú, z({},)c                 3   ó   � | ]}ˆ   |¡V  qd S ©N©Ú_print)r   Úitem©rC   r   r   Ú	<genexpr>B   ó   € z*NumPyPrinter._print_seq.<locals>.<genexpr>)r;   Újoin)rC   ÚseqÚ	delimiterr   rL   r   Ú
_print_seq=   s   zNumPyPrinter._print_seqc                 C   s   d|   tj¡ S )Nú-)rJ   r   r2   ©rC   Úexprr   r   r   Ú_print_NegativeInfinityD   s   z$NumPyPrinter._print_NegativeInfinityc                    sj   |  ¡ d tjur%|  ¡ d |  ¡ d g }d d ‡ fdd„|D ƒ¡¡S d d ‡ fdd„|jD ƒ¡¡S )zMatrix multiplication printerr   r   ú({})z).dot(c                 3   rG   rH   rI   ©r   ÚirL   r   r   rM   K   rN   z-NumPyPrinter._print_MatMul.<locals>.<genexpr>c                 3   rG   rH   rI   rX   rL   r   r   rM   L   rN   )Zas_coeff_matricesr   ÚOner;   rO   Úargs)rC   rU   Ú	expr_listr   rL   r   Ú_print_MatMulG   s    zNumPyPrinter._print_MatMulc                 C   s2   d  |  | jd ¡|  |jd ¡|  |jd ¡¡S )zMatrix power printerz
{}({}, {})z.linalg.matrix_powerr   r   ©r;   Ú_module_formatr<   rJ   r[   rT   r   r   r   Ú_print_MatPowN   s   ÿzNumPyPrinter._print_MatPowc                 C   ó$   d  |  | jd ¡|  |jd ¡¡S )zMatrix inverse printerú{}({})z.linalg.invr   r^   rT   r   r   r   Ú_print_InverseS   s   ÿzNumPyPrinter._print_Inversec                 C   sX   |j \}}|jd dkr|j}|jd dkr|j}d|  | jd ¡|  |¡|  |¡f S )Nr   r   ú
%s(%s, %s)z.dot)r[   ÚshapeÚTr_   r<   rJ   )rC   rU   Úarg1Úarg2r   r   r   Ú_print_DotProductX   s   
þzNumPyPrinter._print_DotProductc                 C   s*   d|   | jd ¡|  |j¡|  |j¡f S )Nrd   z.linalg.solve)r_   r<   rJ   ÚmatrixÚvectorrT   r   r   r   Ú_print_MatrixSolvee   s   

þzNumPyPrinter._print_MatrixSolvec                 C   ó    d  |  | jd ¡|  |j¡¡S )Nrb   z.zeros©r;   r_   r<   rJ   re   rT   r   r   r   Ú_print_ZeroMatrixj   ó   
ÿzNumPyPrinter._print_ZeroMatrixc                 C   rm   )Nrb   z.onesrn   rT   r   r   r   Ú_print_OneMatrixn   rp   zNumPyPrinter._print_OneMatrixc                    s~   ddl m}m} |j}t|tƒst||f|||ƒƒ}d ˆ  ˆ jd ¡d 	‡ fdd„|j
d D ƒ¡ˆ  |j
d ¡ˆ  |j¡¡S )	Nr   )rY   Újz{}(lambda {}: {}, {})z.fromfunctionrF   c                 3   rG   rH   rI   ©r   ÚargrL   r   r   rM   x   rN   z5NumPyPrinter._print_FunctionMatrix.<locals>.<genexpr>r   )Ú	sympy.abcrY   rr   ÚlamdaÚ
isinstancer   r;   r_   r<   rO   r[   rJ   re   )rC   rU   rY   rr   rv   r   rL   r   Ú_print_FunctionMatrixr   s   
þz"NumPyPrinter._print_FunctionMatrixc                    óZ   ˆ  ˆjd ¡‰ d ‡ ‡fdd„|jd d… D ƒ¡d ˆ |jd ¡dt|jƒd  ¡ S )	Nú	.multiplyÚ c                 3   ó"   � | ]}d   ˆ ˆ |¡¡V  qdS ©z{}({}, N©r;   rJ   rs   ©ÚfuncrC   r   r   rM   }   ó   € ÿz6NumPyPrinter._print_HadamardProduct.<locals>.<genexpr>éÿÿÿÿú{}{}ú)r   ©r_   r<   rO   r[   r;   rJ   ÚlenrT   r   r   r   Ú_print_HadamardProduct{   ó   ÿÿÿz#NumPyPrinter._print_HadamardProductc                    ry   )	Nz.kronr{   c                 3   r|   r}   r~   rs   r   r   r   rM   ƒ   r�   z7NumPyPrinter._print_KroneckerProduct.<locals>.<genexpr>r‚   rƒ   r„   r   r…   rT   r   r   r   Ú_print_KroneckerProduct�   rˆ   z$NumPyPrinter._print_KroneckerProductc                 C   s2   d  |  | jd ¡|  | jd ¡|  |jd ¡¡S )Nz
{}({}({}))z
.conjugatez
.transposer   r^   rT   r   r   r   Ú_print_Adjoint‡   s
   ýzNumPyPrinter._print_Adjointc                 C   s8   d  |  | jd ¡|  |j¡¡}d  |  | jd ¡|¡S )Nrb   z.diagz{}({}, (-1, 1))z.reshape)r;   r_   r<   rJ   rt   )rC   rU   Úvectr   r   r   Ú_print_DiagonalOf�   s   
þÿzNumPyPrinter._print_DiagonalOfc                 C   ra   )Nrb   z	.diagflatr   r^   rT   r   r   r   Ú_print_DiagMatrix”   s   ÿzNumPyPrinter._print_DiagMatrixc              
   C   sJ   d  |  | jd ¡|  |j¡|  | jd ¡|  |jd ¡|  |jd ¡¡S )Nz{}({}, {}({}, {}))rz   ú.eyer   r   )r;   r_   r<   rJ   rt   re   rT   r   r   r   Ú_print_DiagonalMatrix˜   s   þz"NumPyPrinter._print_DiagonalMatrixc                    s„   ddl m‰ m‰ ‡ ‡‡fdd„‰d d ‡fdd„|jD ƒ¡¡}d d ‡fd	d„|jD ƒ¡¡}d
 ˆ ˆjd ¡||ˆ t	j
¡¡S )zPiecewise function printerr   )ÚITEÚsimplify_logicc                    s"   |   ˆ ¡rˆ ˆ| ƒ¡S ˆ | ¡S )z$ Problem having an ITE in the cond. )ÚhasrJ   ©Úcond)r�   rC   r‘   r   r   Ú
print_cond    s   

z1NumPyPrinter._print_Piecewise.<locals>.print_condz[{}]ú,c                 3   s   � | ]	}ˆ   |j¡V  qd S rH   )rJ   rU   rs   rL   r   r   rM   ¦   s   € z0NumPyPrinter._print_Piecewise.<locals>.<genexpr>c                 3   s   � | ]}ˆ |j ƒV  qd S rH   r“   rs   )r•   r   r   rM   §   rN   z{}({}, {}, default={})z.select)Úsympy.logic.boolalgr�   r‘   r;   rO   r[   r_   r<   rJ   r   r1   )rC   rU   ÚexprsÚcondsr   )r�   r•   rC   r‘   r   Ú_print_Piecewise�   s     
þzNumPyPrinter._print_Piecewisec                    sf   dddddddœ}|j |v r-|  |j¡}|  |j¡}dj|  | jd	 ||j   ¡||d
�S tƒ  |¡S )z.Relational printer for Equality and UnequalityÚequalÚ	not_equalÚlessÚ
less_equalÚgreaterÚgreater_equal)z==z!=ú<z<=ú>z>=z{op}({lhs}, {rhs})Ú.)ÚopÚlhsÚrhs)	Úrel_oprJ   r¥   r¦   r;   r_   r<   r@   Ú_print_Relational)rC   rU   r¤   r¥   r¦   rD   r   r   r¨   °   s   ú
ÿzNumPyPrinter._print_Relationalc                    ó.   d  ˆ  ˆ jd ¡d ‡ fdd„|jD ƒ¡¡S )úLogical And printerú{}.reduce(({}))z.logical_andr–   c                 3   rG   rH   rI   rX   rL   r   r   rM   Æ   rN   z*NumPyPrinter._print_And.<locals>.<genexpr>©r;   r_   r<   rO   r[   rT   r   rL   r   Ú
_print_AndÁ   ó   .zNumPyPrinter._print_Andc                    r©   )úLogical Or printerr«   z.logical_orr–   c                 3   rG   rH   rI   rX   rL   r   r   rM   Í   rN   z)NumPyPrinter._print_Or.<locals>.<genexpr>r¬   rT   r   rL   r   Ú	_print_OrÈ   r®   zNumPyPrinter._print_Orc                    r©   )zLogical Not printerrb   z.logical_notr–   c                 3   rG   rH   rI   rX   rL   r   r   rM   Ô   rN   z*NumPyPrinter._print_Not.<locals>.<genexpr>r¬   rT   r   rL   r   Ú
_print_NotÏ   r®   zNumPyPrinter._print_NotFc                 C   s<   |j jr|j jrt|j|j  ¡ dd�}| j||| jd d�S )NF)Úevaluatez.sqrt)ÚrationalÚsqrt)ÚexpÚ
is_integerÚis_negativer   ÚbaseÚevalfÚ_hprint_Powr<   )rC   rU   r³   r   r   r   Ú
_print_PowÖ   s   zNumPyPrinter._print_Powr¤   c                    sl   t |ƒdkrtd|› �ƒ‚t |ƒdkrˆ  |d ¡S ˆ  d¡}‡ fdd„|D ƒ}|› d|› dd	 |¡› d
�S )Nr   zNeed at least one argument for r   zfunctools.reducec                    ó   g | ]}ˆ   |¡‘qS r   rI   rs   rL   r   r   r   â   ó    z8NumPyPrinter._helper_minimum_maximum.<locals>.<listcomp>ú(z, [rF   z]))r†   ÚNotImplementedErrorrJ   r_   rO   )rC   r¤   r[   Ú_reduceÚs_argsr   rL   r   Ú_helper_minimum_maximumÜ   s   
z$NumPyPrinter._helper_minimum_maximumc                 C   ó
   |   |¡S rH   )Ú_print_minimumrT   r   r   r   Ú
_print_Minå   ó   
zNumPyPrinter._print_Minc                 C   ó*   d  |  | jd ¡|  |j¡|  |j¡¡S )Nú{}({}, axis={})z.amin©r;   r_   r<   rJ   ÚarrayÚaxisrT   r   r   r   Ú_print_aminè   ó   *zNumPyPrinter._print_aminc                 C   ó$   |   | jd ¡}| j|g|j¢R Ž S )Nz.minimum©r_   r<   rÂ   r[   ©rC   rU   r¤   r   r   r   rÄ   ë   ó   zNumPyPrinter._print_minimumc                 C   rÃ   rH   )Ú_print_maximumrT   r   r   r   Ú
_print_Maxï   rÆ   zNumPyPrinter._print_Maxc                 C   rÇ   )NrÈ   z.amaxrÉ   rT   r   r   r   Ú_print_amaxò   rÍ   zNumPyPrinter._print_amaxc                 C   rÎ   )Nz.maximumrÏ   rÐ   r   r   r   rÒ   õ   rÑ   zNumPyPrinter._print_maximumc                 C   ó$   d|   | jd ¡|  |jd ¡f S )Nú%s(%s)z.angler   ©r_   r<   rJ   r[   rT   r   r   r   Ú
_print_argù   ó   $zNumPyPrinter._print_argc                 C   rÕ   )NrÖ   z.imagr   r×   rT   r   r   r   Ú	_print_imü   rÙ   zNumPyPrinter._print_imc                    s.   dˆ   ˆ jd ¡d ‡ fdd„|jD ƒ¡f S )NrÖ   z.modrF   c                 3   rG   rH   rI   rs   rL   r   r   rM     rN   z*NumPyPrinter._print_Mod.<locals>.<genexpr>)r_   r<   rO   r[   rT   r   rL   r   Ú
_print_Modÿ   s   ÿzNumPyPrinter._print_Modc                 C   rÕ   )NrÖ   z.realr   r×   rT   r   r   r   Ú	_print_re  rÙ   zNumPyPrinter._print_rec                 C   s*   d|   | jd ¡|  |jd tj ¡f S )NrÖ   z.sincr   )r_   r<   rJ   r[   r   r/   rT   r   r   r   Ú_print_sinc  rÍ   zNumPyPrinter._print_sincc                 C   s|   d|j v r|  | j› d| j› �¡}|› d|  |j ¡› d�S | j |jjd ¡}|d u r3|  | j› d�¡}d||  | 	¡ ¡f S )Nr   r£   r¾   r„   ú.arrayrÖ   )
re   r_   r<   Ú_zerosrJ   Úknown_functionsÚgetrE   Ú__name__Útolist©rC   rU   r€   r   r   r   Ú_print_MatrixBase	  s   
zNumPyPrinter._print_MatrixBasec                 C   sD   |j }tdd„ |D ƒƒrd|  | jd ¡|  |j d ¡f S tdƒ‚)Nc                 s   s   � | ]}|j V  qd S rH   )Ú
is_Integer)r   Údimr   r   r   rM     s   € z/NumPyPrinter._print_Identity.<locals>.<genexpr>rÖ   rŽ   r   zFSymbolic matrix dimensions are not yet supported for identity matrices)re   Úallr_   r<   rJ   r¿   )rC   rU   re   r   r   r   Ú_print_Identity  s   $zNumPyPrinter._print_Identityc                 C   s(   d  |  | jd ¡|  |jd  ¡ ¡¡S )Nrb   z.blockr   )r;   r_   r<   rJ   r[   rã   rT   r   r   r   Ú_print_BlockMatrix  s   ÿzNumPyPrinter._print_BlockMatrixc                 C   sž   |  ¡ dkr|  | j› d�¡}|› d|  |d ¡› d�S d|jv r9|  | j› d| j› �¡}|› d|  |j¡› d�S |  | j› d�¡}|› d|  | ¡ ¡› d�S )Nr   rÞ   r¾   r   r„   r£   )Úrankr_   r<   rJ   re   rß   rã   rä   r   r   r   Ú_print_NDimArray  s   
zNumPyPrinter._print_NDimArrayÚaddÚeinsumÚ	transposeÚonesÚzerosrH   )F)=râ   Ú
__module__Ú__qualname__Ú__doc__r<   Ú_numpy_known_functionsr?   Ú_numpy_known_constantsÚ_kcrA   rR   rV   r]   r`   rc   ri   rl   ro   rq   rx   r‡   r‰   rŠ   rŒ   r�   r�   rš   r¨   r­   r°   r±   r»   ÚstrrÂ   rÅ   rÌ   rÄ   rÓ   rÔ   rÒ   rØ   rÚ   rÛ   rÜ   rÝ   rå   ré   rê   rì   Ú_addÚ_einsumÚ
_transposeÚ_onesrß   r   Ú_print_not_supportedÚ_print_lowergammaÚ_print_uppergammaÚ_print_fresnelcÚ_print_fresnelsÚ__classcell__r   r   rD   r   r7   %   sj    	
		
r7   Ú_print_ÚEiZexpiÚerfÚerfcÚbesseljÚjvÚbesselyZyvÚbesseliÚivÚbesselkÚkvZcosm1Úpowm1Ú	factorialÚgammaÚloggammaÚgammalnÚdigammaÚpsiÚ	polygammaÚRisingFactorialZpochÚjacobiZeval_jacobiÚ
gegenbauerZeval_gegenbauerZeval_chebytZeval_chebyuZeval_legendreZeval_hermiteZeval_laguerreZeval_genlaguerreÚbetaÚlambertw)Ú
chebyshevtÚ
chebyshevuÚlegendreÚhermiteÚlaguerreÚassoc_laguerrer  ÚLambertWZgolden_ratio)ÚGoldenRatior/   c                 C   r3   )zscipy.special.r   r   r   r   r   r5   Y  r6   c                 C   r3   )zscipy.constants.r   r   r   r   r   r5   Z  r6   c                       sÆ   e Zd Zi ej¥e¥Zi ej¥e¥Zd&‡ fdd„	Zdd„ Z	e	Z
dd„ Zdd	„ Zd
d„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd d!„ Zd"d#„ Zd$d%„ Z‡  ZS )'ÚSciPyPrinterNc                    ó   t ƒ j|d� d| _d S )Nr9   zPython with SciPy and NumPy)r@   rA   r=   rB   rD   r   r   rA   a  ó   
zSciPyPrinter.__init__c                 C   sd   g g g }}}|  ¡  ¡ D ]\\}}}| |¡ | |¡ | |¡ qdj|  d¡||||jd�S )Nz+{name}(({data}, ({i}, {j})), shape={shape})zscipy.sparse.coo_matrix)ÚnameÚdatarY   rr   re   )ÚtodokÚitemsÚappendr;   r_   re   )rC   rU   rY   rr   r'  ÚrÚcr   r   r   r   Ú_print_SparseRepMatrixe  s   


þz#SciPyPrinter._print_SparseRepMatrixc              	   C   s:   d  |  d¡|  |jd ¡|  |jd ¡|  |jd ¡¡S )Nz{0}({2}, {1}, {3})zscipy.special.lpmvr   r   é   ©r;   r_   rJ   r[   rT   r   r   r   Ú_print_assoc_legendret  s   üz"SciPyPrinter._print_assoc_legendrec              	   C   ó4   d  |  d¡|  d¡|  |jd ¡|  |jd ¡¡S )Nú{0}({2})*{1}({2}, {3})úscipy.special.gammazscipy.special.gammaincr   r   r/  rT   r   r   r   rþ   {  ó   üzSciPyPrinter._print_lowergammac              	   C   r1  )Nr2  r3  zscipy.special.gammainccr   r   r/  rT   r   r   r   rÿ   ‚  r4  zSciPyPrinter._print_uppergammac                    s�   ˆ   d¡}ˆ   d¡}‡ fdd„|jD ƒ}d|› d|d › d|d › d|d	 › d
|› d|d › d|d › d|d › d|› d|d › d|d › d�S )Núscipy.special.betainczscipy.special.betac                    r¼   r   rI   rs   rL   r   r   r   Œ  r½   z/SciPyPrinter._print_betainc.<locals>.<listcomp>r¾   r   rF   r   é   z) - r.  z))             * r„   )r_   r[   )rC   rU   Úbetaincr  r[   r   rL   r   Ú_print_betainc‰  s   

JÿÿÿzSciPyPrinter._print_betaincc              
   C   sH   d  |  d¡|  |jd ¡|  |jd ¡|  |jd ¡|  |jd ¡¡S )Nz'{0}({1}, {2}, {4}) - {0}({1}, {2}, {3})r5  r   r   r.  r6  r/  rT   r   r   r   Ú_print_betainc_regularized�  s   ûz'SciPyPrinter._print_betainc_regularizedc                 C   ó   d  |  d¡|  |jd ¡¡S )Nú	{}({})[0]úscipy.special.fresnelr   r/  rT   r   r   r   r  ˜  ó   þzSciPyPrinter._print_fresnelsc                 C   r:  )Nú	{}({})[1]r<  r   r/  rT   r   r   r   r   �  r=  zSciPyPrinter._print_fresnelcc                 C   r:  )Nr;  úscipy.special.airyr   r/  rT   r   r   r   Ú_print_airyai¢  r=  zSciPyPrinter._print_airyaic                 C   r:  )Nr>  r?  r   r/  rT   r   r   r   Ú_print_airyaiprime§  r=  zSciPyPrinter._print_airyaiprimec                 C   r:  )Nz	{}({})[2]r?  r   r/  rT   r   r   r   Ú_print_airybi¬  r=  zSciPyPrinter._print_airybic                 C   r:  )Nz	{}({})[3]r?  r   r/  rT   r   r   r   Ú_print_airybiprime±  r=  zSciPyPrinter._print_airybiprimec                 C   ó   |   |j|jŽ ¡S rH   ©rJ   Ú_eval_rewrite_as_zetar[   rT   r   r   r   Ú_print_bernoulli¶  s   zSciPyPrinter._print_bernoullic                 C   rD  rH   rE  rT   r   r   r   Ú_print_harmonicº  ó   zSciPyPrinter._print_harmonicc                    sŽ   t |ƒ\}}t|ƒdkrˆ  d¡}dttˆ j|d ƒƒ }nˆ  d¡}d d ‡ fdd	„|D ƒ¡¡}d
 |d tˆ j|ƒ¡ˆ  |jd ¡|¡S )Nr   zscipy.integrate.quadz%s, %sr   zscipy.integrate.nquadrW   rF   c                 3   s$   � | ]}d t tˆ j|ƒƒ V  qdS )z(%s, %s)N)ÚtupleÚmaprJ   )r   ÚlrL   r   r   rM   Æ  s   € 
ÿz/SciPyPrinter._print_Integral.<locals>.<genexpr>z{}(lambda {}: {}, {})[0])	r
   r†   r_   rJ  rK  rJ   r;   rO   r[   )rC   r)   Úintegration_varsÚlimitsÚ
module_strZ	limit_strr   rL   r   Ú_print_Integral½  s   


ÿüzSciPyPrinter._print_Integralc                 C   r:  )Nr;  úscipy.special.sicir   r/  rT   r   r   r   Ú	_print_SiÏ  r=  zSciPyPrinter._print_Sic                 C   r:  )Nr>  rQ  r   r/  rT   r   r   r   Ú	_print_CiÔ  r=  zSciPyPrinter._print_CirH   )râ   rò   ró   r7   r?   Ú_scipy_known_functionsr÷   Ú_scipy_known_constantsrA   r-  Ú_print_ImmutableSparseMatrixr0  rþ   rÿ   r8  r9  r  r   r@  rA  rB  rC  rG  rH  rP  rR  rS  r  r   r   rD   r   r#  \  s,    r#  c                 C   r3   ©zcupy.r   r   r   r   r   r5   à  r6   c                 C   r3   rW  r   r   r   r   r   r5   á  r6   c                       s.   e Zd ZdZdZeZeZd‡ fdd„	Z	‡  Z
S )ÚCuPyPrinterz`
    CuPy printer which handles vectorized piecewise functions,
    logical operators, etc.
    ÚcupyNc                    s   t ƒ j|d� d S )Nr9   )r@   rA   rB   rD   r   r   rA   í  rI  zCuPyPrinter.__init__rH   )râ   rò   ró   rô   r<   Ú_cupy_known_functionsr?   Ú_cupy_known_constantsr÷   rA   r  r   r   rD   r   rX  ã  s    rX  c                 C   r3   ©z
jax.numpy.r   r   r   r   r   r5   ÷  r6   c                 C   r3   r\  r   r   r   r   r   r5   ø  r6   c                       s>   e Zd ZdZdZeZeZd
‡ fdd„	Z	dd„ Z
dd	„ Z‡  ZS )Ú
JaxPrinterz_
    JAX printer which handles vectorized piecewise functions,
    logical operators, etc.
    z	jax.numpyNc                    r$  )Nr9   Z_jaxcode)r@   rA   r>   rB   rD   r   r   rA     r%  zJaxPrinter.__init__c              	      ó8   d  ˆ  ˆ jd ¡ˆ  ˆ j¡d ‡ fdd„|jD ƒ¡¡S )rª   ú{}({}.asarray([{}]), axis=0)z.allr–   c                 3   rG   rH   rI   rX   rL   r   r   rM     rN   z(JaxPrinter._print_And.<locals>.<genexpr>r¬   rT   r   rL   r   r­   	  ó
   
ýzJaxPrinter._print_Andc              	      r^  )r¯   r_  z.anyr–   c                 3   rG   rH   rI   rX   rL   r   r   rM     rN   z'JaxPrinter._print_Or.<locals>.<genexpr>r¬   rT   r   rL   r   r°     r`  zJaxPrinter._print_OrrH   )râ   rò   ró   rô   r<   Ú_jax_known_functionsr?   Ú_jax_known_constantsr÷   rA   r­   r°   r  r   r   rD   r   r]  ú  s    r]  N)'Ú
sympy.corer   Úsympy.core.functionr   Úsympy.core.powerr   Úpycoder   r   r   r	   r
   r   Úcodeprinterr   Úsplitr   r)  Z	_in_numpyÚdictZ_known_functions_numpyZ_known_constants_numpyrõ   rö   r7   r€   ÚsetattrÚconstZ_known_functions_scipy_specialZ _known_constants_scipy_constantsrT  rU  r#  rZ  r[  rX  ra  rb  r]  r   r   r   r   Ú<module>   sÔ     
óû  ÿþýüûúùø	÷
öõôóòñðïçþ}ÿ