+
    ‹°³jõ[  ã                  óŒ  € R t ^ RIHt ^ RIHt ^ RIHtHtHtH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt . R	NR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-NR.NR/NR0NR1NR2NR3NR4NR5NR6NR7NR8NR9NR:NtR;R<R=R>R?R@RARBRCRDRERFRGRH/t ! RI RJ]4      tRNRL ltRM tRK# )Oa  
Julia code printer

The `JuliaCodePrinter` converts SymPy expressions into Julia expressions.

A complete code generator, which uses `julia_code` extensively, can be found
in `sympy.utilities.codegen`.  The `codegen` module can be used to generate
complete source code files.

)Úannotations)ÚAny)ÚMulÚPowÚSÚRational)Ú_keep_coeff)Úequal_valued)ÚCodePrinter)Ú
precedenceÚ
PRECEDENCE©ÚsearchÚsinÚcosÚtanÚcotÚsecÚcscÚasinÚacosÚatanÚacotÚasecÚacscÚsinhÚcoshÚtanhÚcothÚsechÚcschÚasinhÚacoshÚatanhÚacothÚasechÚacschÚatan2ÚsignÚfloorÚlogÚexpÚcbrtÚsqrtÚerfÚerfcÚerfiÚ	factorialÚgammaÚdigammaÚtrigammaÚ	polygammaÚbetaÚairyaiÚairyaiprimeÚairybiÚairybiprimeÚbesseljÚbesselyÚbesseliÚbesselkÚerfinvÚerfcinvÚAbsÚabsÚceilingÚceilÚ	conjugateÚconjÚhankel1Úhankelh1Úhankel2Úhankelh2ÚimÚimagÚreÚrealc                  ó¤  a € ] tR t^0t$ RtRtRtRRRRRR	/t]! ]	P                  3/ R
^R/ RRRR/B t
R]R&   / 3V 3R lltR tR tR tR tR tR tR tR tR tR tR tV 3R ltR tV 3R ltV 3R  ltV 3R! ltV 3R" ltR# tR$ tR% t R& t!R' t"R( t#]#t$R) t%R* t&R+ t'R, t(R- t)R. t*R/ t+R0 t,R1 t-R2 t.R3 t/R4 t0R5 t1R6 t2R7 t3R8 t4R9 t5R: t6R;t7V ;t8# )<ÚJuliaCodePrinterz<
A printer to convert expressions to strings of Julia code.
Ú_juliaÚJuliaÚandz&&Úorz||ÚnotÚ!Ú	precisionÚuser_functionsÚcontractTÚinlinezdict[str, Any]Ú_default_settingsc                	ó  <€ \         SV `  V4       \        \        \        \        4      4      V n        V P
                  P                  \        \        4      4       VP                  R / 4      pV P
                  P                  V4       R# )rX   N)	ÚsuperÚ__init__ÚdictÚzipÚknown_fcns_src1Úknown_functionsÚupdateÚknown_fcns_src2Úget)ÚselfÚsettingsÚ	userfuncsÚ	__class__s   && €ÚU/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/printing/julia.pyr^   ÚJuliaCodePrinter.__init__G   sb   ø€ Ü‰Ñ˜Ô"Ü#¤C¬¼Ó$IÓJˆÔØ×Ñ×#Ñ#¤D¬Ó$9Ô:Ø—L‘LÐ!1°2Ó6ˆ	Ø×Ñ×#Ñ# IÖ.ó    c                	ó   € V^,          # )é   © )rf   Úps   &&rj   Ú_rate_index_positionÚ%JuliaCodePrinter._rate_index_positionO   s   € Ø��sˆ
rl   c                	ó   € R V,          # )z%sro   )rf   Ú
codestrings   &&rj   Ú_get_statementÚJuliaCodePrinter._get_statementS   s   € Ø�jÕ Ð rl   c                	ó$   € R P                  V4      # )z# {}©Úformat)rf   Útexts   &&rj   Ú_get_commentÚJuliaCodePrinter._get_commentW   s   € Ø�}‰}˜TÓ"Ð"rl   c                	ó$   € R P                  W4      # )zconst {} = {}rx   )rf   ÚnameÚvalues   &&&rj   Ú_declare_number_constÚ&JuliaCodePrinter._declare_number_const[   s   € Ø×%Ñ% dÓ2Ð2rl   c                	ó$   € V P                  V4      # ©N)Úindent_code)rf   Úliness   &&rj   Ú_format_codeÚJuliaCodePrinter._format_code_   s   € Ø×Ñ Ó&Ð&rl   c                	óL   a€ VP                   w  opV3R  l\        V4       4       # )c              3  óN   <"  € T F  p\        S4       F  q"V3x € K
  	  K  	  R # 5irƒ   )Úrange)Ú.0ÚjÚiÚrowss   &  €rj   Ú	<genexpr>Ú<JuliaCodePrinter._traverse_matrix_indices.<locals>.<genexpr>f   s   øé € ÐA¡˜1´U¸4¶[°�A•±[‘£ùs   ƒ"%)ÚshaperŠ   )rf   ÚmatÚcolsrŽ   s   && @rj   Ú_traverse_matrix_indicesÚ)JuliaCodePrinter._traverse_matrix_indicesc   s   ø€ à—Y‘Y‰
ˆˆdÜA¤ d¤ÓAÐArl   c           	     	ó  € . p. pV Fy  p\        V P                  VP                  VP                  ^,           VP                  ^,           .4      w  rVpVP                  RV: RV: RV: 24       VP                  R4       K{  	  W#3# )é   zfor ú = Ú:Úend)ÚmapÚ_printÚlabelÚlowerÚupperÚappend)rf   ÚindicesÚ
open_linesÚclose_linesr�   ÚvarÚstartÚstops   &&      rj   Ú_get_loop_opening_endingÚ)JuliaCodePrinter._get_loop_opening_endingi   sw   € Øˆ
ØˆÛˆAä" 4§;¡;Ø—W‘W˜aŸg™g¨�k¨1¯7©7°Q­;Ð7ó 9ÑˆC˜à×Ò³#³uºdÐCÔDØ×Ñ˜uÖ%ñ ð Ð&Ð&rl   c           	     	ó@  € VP                   '       dh   VP                  '       dV   VP                  4       ^ ,          P                  '       d/   RV P	                  \
        P                  ) V,          4      ,          # \        V4      pVP                  4       w  r4V^ 8  d   \        V) V4      pRpMRp. p. p. pV P                  R9  d   VP                  4       p	M\        P                  ! V4      p	V	 EF¥  p
V
P                  '       Ed    V
P                  '       Ed   V
P                  P                   '       dñ   V
P                  P"                  '       dÕ   V
P                  R8w  d5   VP%                  \'        V
P(                  V
P                  ) RR7      4       K§  \+        V
P,                  ^ ,          P,                  4      ^8w  d2   \/        V
P(                  \        4      '       d   VP%                  V
4       VP%                  \'        V
P(                  V
P                  ) 4      4       EK6  V
P                   '       dM   V
\
        P0                  Jd9   V
P2                  ^8X  d(   VP%                  \5        V
P6                  4      4       EK”  VP%                  V
4       EK¨  	  T;'       g    \
        P8                  .pV Uu. uF  q°P;                  W²4      NK  	  ppV Uu. uF  q°P;                  W²4      NK  	  ppV FY  p
V
P(                  V9   g   K  RW×P=                  V
P(                  4      ,          ,          W×P=                  V
P(                  4      &   K[  	  R pV'       g   W^! Wl4      ,           # \+        V4      ^8X  d>   V^ ,          P                   '       d   RMR	pW^! Wl4      ,           : R
V: R
V^ ,          : 2# \>        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       d   RMR	pW^! Wl4      ,           : R
V: RV! W}4      : R2# u upi u upi )é    z%simÚ-Ú F)Úevaluateú(%s)c                ó¼   € V^ ,          p\        ^\        V 4      4       F9  pW^,
          ,          P                  '       d   RMRpV: RV: RW,          : 2pK;  	  V# )rª   Ú*z.*Ú )rŠ   ÚlenÚ	is_number)ÚaÚa_strÚrr�   Úmulsyms   &&   rj   ÚmultjoinÚ-JuliaCodePrinter._print_Mul.<locals>.multjoin®   sM   € à�a•ˆAÜ˜1œc !›fÖ%�Ø ! A¥#¥× 0× 0Ð 0™°d�Û"#£V¨U¯XÐ6’ñ &ð ˆHrl   Ú/ú./r±   c              3  ó8   "  € T F  qP                   x € K  	  R # 5irƒ   ©r³   )r‹   Úbis   & rj   r�   Ú.JuliaCodePrinter._print_Mul.<locals>.<genexpr>¼   s   é € Ð9±q°§¦³qùó   ‚Tz (Ú))ÚoldÚnoneéÿÿÿÿ) r³   Úis_imaginaryÚas_coeff_MulÚ
is_integerrœ   r   ÚImaginaryUnitr   r   ÚorderÚas_ordered_factorsr   Ú	make_argsÚis_commutativeÚis_Powr+   Úis_RationalÚis_negativer    r   Úbaser²   ÚargsÚ
isinstanceÚInfinityrp   r   ÚqÚOneÚparenthesizeÚindexÚall)rf   ÚexprÚprecÚcÚer(   r´   ÚbÚ	pow_parenrÑ   ÚitemÚxrµ   Úb_strr¸   Údivsyms   &&              rj   Ú
_print_MulÚJuliaCodePrinter._print_Mulu   sø  € à�N�NˆN˜t×0×0Ð0Ø×!Ñ!Ó# AÕ&×1×1Ð1Ø˜DŸK™K¬¯©Ð(8¸Õ(=Ó>Õ>Ð>ô ˜$Óˆà× Ñ Ó"‰ˆØˆqŒ5Ü ˜r 1Ó%ˆDØ‰DàˆDàˆØˆàˆ	à�:‰:˜_Ô,Ø×*Ñ*Ó,‰Dô —=’= Ó&ˆDô ˆDØ×#×#Ñ#¨¯¯©¸¿¹×8L×8LÐ8LØŸ™×,×,Ð,Ø—8‘8˜r”>Ø—H‘HœS §¡¨T¯X©X¨IÀÔFÖGä˜4Ÿ9™9 Q�<×,Ñ,Ó-°Ô2´zÀ$Ç)Á)ÌS×7QÒ7QØ!×(Ñ(¨Ô.Ø—H‘HœS §¡¨T¯X©X¨IÓ6×7Ø×!×!Ð! d´!·*±*Ó&<ÀÇÁÈ1Äð
 —‘œ $§&¡&Ó)×*à—‘˜—ñ! ð$ �LˆL”!—%‘%�ˆá56Ó7±Q°×"Ñ" 1Ö+±QˆÐ7Ù56Ó7±Q°×"Ñ" 1Ö+±QˆÐ7ó ˆDØ�y‰y˜AŽ~Ø,2°U¿7¹7À4Ç9Á9Ó;MÕ5NÕ,N�—g‘g˜dŸi™iÓ(Ó)ñ ò
	÷ Ø˜( 1Ó,Õ,Ð,Ü�‹V�qŒ[Ø˜a�DŸNŸN˜N‘S°ˆFØ!% h¨qÓ&8×!8Ð!8»&À%ÈÇ(ÐKÐKç›CÑ9±qÓ9ŸCŸCšCÑ9±qÓ9×9Ò9‘S¸tˆFØ#'¨(°1Ó*<×#<Ð#<»fÁhÈqÖFXÐYÐYùò1 8ùÚ7s   Ê9PËPc                	óª   € V P                  VP                  4      pV P                  VP                  4      pVP                  pR P	                  W$V4      # )z{} {} {})rœ   ÚlhsÚrhsÚrel_opry   )rf   rÙ   Úlhs_codeÚrhs_codeÚops   &&   rj   Ú_print_RelationalÚ"JuliaCodePrinter._print_Relational¿   sB   € Ø—;‘;˜tŸx™xÓ(ˆØ—;‘;˜tŸx™xÓ(ˆØ�[‰[ˆØ× Ñ  ¨xÓ8Ð8rl   c                	ó^  € \         ;QJ d&    R  VP                   4       F  '       d   K   RM	  RM! R  VP                   4       4      '       d   RMRp\        V4      p\        VP                  R4      '       d#   RV P                  VP                  4      ,          # VP                  '       dÁ   \        VP                  R4      '       dE   VP                  P                  '       d   RMRpR	V: R
V P                  VP                  4      : R2# \        VP                  R4      '       dE   VP                  P                  '       d   RMRpR	V: RV P                  VP                  V4      : 2# V P                  VP                  V4      : RV: RV P                  VP                  V4      : 2# )c              3  ó8   "  € T F  qP                   x € K  	  R # 5irƒ   r½   )r‹   rà   s   & rj   r�   Ú.JuliaCodePrinter._print_Pow.<locals>.<genexpr>Æ   s   é € Ð>±I¨qŸ{ž{³IùrÀ   FTÚ^z.^g      à?zsqrt(%s)rº   r»   z1 z sqrt(rÁ   r±   g      à¿rÄ   )
rØ   rÑ   r   r	   r+   rœ   rÐ   rÌ   r³   rÖ   )rf   rÙ   Ú	powsymbolÚPRECÚsyms   &&   rj   Ú
_print_PowÚJuliaCodePrinter._print_PowÅ   s&  € ß›3Ñ>°D·I²IÓ>Ÿ3Ÿ3š3Ñ>°D·I²IÓ>×>Ò>‘CÀDˆ	ä˜$Óˆä˜Ÿ™ #×&Ò&Ø §¡¨D¯I©IÓ 6Õ6Ð6à××ÐÜ˜DŸH™H d×+Ò+Ø!ŸY™Y×0×0Ð0‘c°d‘Û*-¨t¯{©{¸4¿9¹9Ö/EÐFÐFÜ˜DŸH™H b×)Ò)Ø!ŸY™Y×0×0Ð0‘c°d‘Û%(¨$×*;Ñ*;¸D¿I¹IÀtÕ*LÐMÐMà!×.Ñ.¨t¯y©y¸$Ö?ÃØ×,Ñ,¨T¯X©X°tÕ<ð>ð 	>rl   c                	ó’   € \        V4      pV P                  VP                  V4      : R V P                  VP                  V4      : 2# )z ^ )r   rÖ   rÐ   r+   ©rf   rÙ   ró   s   && rj   Ú_print_MatPowÚJuliaCodePrinter._print_MatPowÙ   s>   € Ü˜$ÓˆØ ×-Ñ-¨d¯i©i¸Ö>Ø×+Ñ+¨D¯H©H°dÕ;ð=ð 	=rl   c                	óX   <€ V P                   R ,          '       d   R# \        SV `	  V4      # )rZ   Úpi©Ú	_settingsr]   Ú_print_NumberSymbol©rf   rÙ   ri   s   &&€rj   Ú	_print_PiÚJuliaCodePrinter._print_Piß   s%   ø€ Ø�>‰>˜(×#Ô#Ùä‘7Ñ.¨tÓ4Ð4rl   c                	ó   € R # )rK   ro   ©rf   rÙ   s   &&rj   Ú_print_ImaginaryUnitÚ%JuliaCodePrinter._print_ImaginaryUnitæ   s   € Ùrl   c                	óX   <€ V P                   R ,          '       d   R# \        SV `	  V4      # )rZ   rÜ   rý   r   s   &&€rj   Ú_print_Exp1ÚJuliaCodePrinter._print_Exp1ê   s%   ø€ Ø�>‰>˜(×#Ô#Ùä‘7Ñ.¨tÓ4Ð4rl   c                	óX   <€ V P                   R ,          '       d   R# \        SV `	  V4      # )rZ   Ú
eulergammarý   r   s   &&€rj   Ú_print_EulerGammaÚ"JuliaCodePrinter._print_EulerGammañ   s%   ø€ Ø�>‰>˜(×#Ô#Ùä‘7Ñ.¨tÓ4Ð4rl   c                	óX   <€ V P                   R ,          '       d   R# \        SV `	  V4      # )rZ   Úcatalanrý   r   s   &&€rj   Ú_print_CatalanÚJuliaCodePrinter._print_Catalanø   s%   ø€ Ø�>‰>˜(×#Ô#Ùä‘7Ñ.¨tÓ4Ð4rl   c                	óX   <€ V P                   R ,          '       d   R# \        SV `	  V4      # )rZ   Úgoldenrý   r   s   &&€rj   Ú_print_GoldenRatioÚ#JuliaCodePrinter._print_GoldenRatioÿ   s%   ø€ Ø�>‰>˜(×#Ô#Ùä‘7Ñ.¨tÓ4Ð4rl   c                	ó¦  € ^ RI Hp ^ RIHp ^ RIHp VP                  pVP                  pV P                  R,          '       g~   \        VP                  V4      '       db   . p. pVP                   F-  w  ršVP                  V! WY4      4       VP                  V
4       K/  	  V! \        Wx4      !  pV P                  V4      # V P                  R,          '       d@   VP                  V4      '       g   VP                  V4      '       d   V P                  We4      # V P                  V4      pV P                  V4      pV P!                  V: RV: 24      # )rª   )Ú
Assignment)Ú	Piecewise)ÚIndexedBaserZ   rY   r˜   )Úsympy.codegen.astr  Ú$sympy.functions.elementary.piecewiser  Úsympy.tensor.indexedr  ræ   rç   rþ   rÒ   rÑ   r    r`   rœ   ÚhasÚ_doprint_loopsru   )rf   rÙ   r  r  r  ræ   rç   ÚexpressionsÚ
conditionsrÜ   rÛ   Útempré   rê   s   &&            rj   Ú_print_AssignmentÚ"JuliaCodePrinter._print_Assignment  s
  € Ý0ÝBÝ4à�h‰hˆØ�h‰hˆà�~‰~˜h×'Ô'¬J°t·x±xÀ×,KÒ,Kð ˆKØˆJØŸ(œ(‘�Ø×"Ñ"¡:¨cÓ#5Ô6Ø×!Ñ! !Ö$ñ #ñ œc +Ó:Ñ;ˆDØ—;‘;˜tÓ$Ð$Ø�>‰>˜*×%Ô%¨3¯7©7°;×+?Ò+?Ø—‘˜×$Ò$ð ×&Ñ& sÓ0Ð0à—{‘{ 3Ó'ˆHØ—{‘{ 3Ó'ˆHØ×&Ñ&³HºhÐ'GÓHÐHrl   c                	ó   € R # )ÚInfro   r  s   &&rj   Ú_print_InfinityÚ JuliaCodePrinter._print_Infinity#  ó   € Ùrl   c                	ó   € R # )z-Infro   r  s   &&rj   Ú_print_NegativeInfinityÚ(JuliaCodePrinter._print_NegativeInfinity'  ó   € Ùrl   c                	ó   € R # )ÚNaNro   r  s   &&rj   Ú
_print_NaNÚJuliaCodePrinter._print_NaN+  r(  rl   c                	óV   a € R RP                  V 3R lV 4       4      ,           R,           # )zAny[ú, c              3  óF   <"  € T F  pSP                  V4      x € K  	  R # 5irƒ   )rœ   )r‹   r´   rf   s   & €rj   r�   Ú/JuliaCodePrinter._print_list.<locals>.<genexpr>0  s   øé € Ð!?¹$°Q $§+¡+¨a§. .»$ùs   ƒ!Ú])Újoinr  s   f&rj   Ú_print_listÚJuliaCodePrinter._print_list/  s"   ø€ Ø˜Ÿ	™	Ô!?¹$Ó!?Ó?Õ?À#ÕEÐErl   c                	ó’   € \        V4      ^8X  d    RV P                  V^ ,          4      ,          # RV P                  VR4      ,          # )r—   z(%s,)r®   r2  )r²   rœ   Ú	stringifyr  s   &&rj   Ú_print_tupleÚJuliaCodePrinter._print_tuple3  s;   € Üˆt‹9˜Œ>Ø˜TŸ[™[¨¨a­Ó1Õ1Ð1à˜DŸN™N¨4°Ó6Õ6Ð6rl   c                	ó   € R # )Útruero   r  s   &&rj   Ú_print_BooleanTrueÚ#JuliaCodePrinter._print_BooleanTrue;  r,  rl   c                	ó   € R # )Úfalsero   r  s   &&rj   Ú_print_BooleanFalseÚ$JuliaCodePrinter._print_BooleanFalse?  s   € Ùrl   c                	ó4   € \        V4      P                  4       # rƒ   )Ústrrž   r  s   &&rj   Ú_print_boolÚJuliaCodePrinter._print_boolC  s   € Ü�4‹y�‰Ó Ð rl   c           	     	ó  € \         P                  VP                  9   d    R VP                  : RVP                  : R2# VP                  VP                  3R	8X  d   RVR
,          ,          # VP                  ^8X  d   RVP                  V RRRR7      ,          # VP                  ^8X  d7   RRP                  V Uu. uF  q P                  V4      NK  	  up4      ,          # RVP                  V RRRRR7      ,          # u upi )zzeros(r2  rÁ   z[%s]r¬   r±   )ÚrowstartÚrowendÚcolsepz;
)rJ  rK  ÚrowseprL  )r—   r—   )rª   rª   )r   ÚZeror‘   rŽ   r“   Útabler6  rœ   )rf   ÚAr´   s   && rj   Ú_print_MatrixBaseÚ"JuliaCodePrinter._print_MatrixBaseK  sÒ   € ä�6‰6�Q—W‘WÕØ&'§f¤f¨a¯f¬fÐ5Ð5Ø�f‰f�a—f‘fÐ Ô'Ø˜A˜d�GÕ#Ð#Ø�V‰V�qŒ[Ø˜AŸG™G D°2¸bÈ˜GÓMÕMÐMØ�V‰V�qŒ[à˜DŸI™I¹qÓ&A¹q¸!§{¡{°1¦~¹qÑ&AÓBÕBÐBØ˜Ÿ™ ¨r¸"Ø',°Sð  ó :õ :ð 	:ùò 'Bs   Â:C=
c                	óÌ  € ^ RI Hp VP                  4       pT! V Uu. uF  qD^ ,          ^,           NK  	  up4      pT! V Uu. uF  qD^,          ^,           NK  	  up4      pT! V Uu. uF  qD^,          NK  	  up4      pRV P                  V4      : RV P                  V4      : RV P                  V4      : RVP                  : RVP
                  : R2# u upi u upi u upi )rª   )ÚMatrixzsparse(r2  rÁ   )Úsympy.matricesrT  Úcol_listrœ   rŽ   r“   )rf   rP  rT  ÚLÚkÚIÚJÚAIJs   &&      rj   Ú_print_SparseRepMatrixÚ'JuliaCodePrinter._print_SparseRepMatrixZ  s³   € Ý)Ø�J‰J‹Lˆá¡aÓ(¡a �a•D˜1—H�H¡aÑ(Ó)ˆÙ¡aÓ(¡a �a•D˜1—H�H¡aÑ(Ó)ˆÙ¡AÓ&¡A˜q˜—d�d¡AÑ&Ó'‰Ø/3¯{©{¸1®~¸t¿{¹{È1¾~Ø,0¯K©K¸Ö,<¸a¿f¼fÀaÇfÄfðNð 	Nùò )ùÚ(ùÚ&s   �CÁCÁ'C!c                	ó¸   € V P                  VP                  \        R ,          RR7      RVP                  ^,           : RVP                  ^,           : R2,           # )ÚAtomT)ÚstrictÚ[Ú,r5  )rÖ   Úparentr   r�   rŒ   r  s   &&rj   Ú_print_MatrixElementÚ%JuliaCodePrinter._print_MatrixElemente  sF   € Ø× Ñ  §¡¬j¸Õ.@ÈÐ ÔNØŸ6™6 AŸ:˜: t§v¡v°§z zÐ2õ3ð 	3rl   c                	ó<  a € V 3R  lpS P                  VP                  4      R,           V! VP                  VP                  P                  ^ ,          4      ,           R,           V! VP                  VP                  P                  ^,          4      ,           R,           # )c                ó>  <€ V ^ ,          ^,           pV ^,          pV ^,          pSP                  V4      pW18X  d   RMSP                  V4      pV^8X  d(   V^8X  d	   W18X  d   R# W#8X  d   V# VR,           V,           # RP                  VSP                  V4      V34      # )rª   rš   r™   )rœ   r6  )rà   ÚlimÚlÚhÚstepÚlstrÚhstrrf   s   &&     €rj   ÚstrsliceÚ5JuliaCodePrinter._print_MatrixSlice.<locals>.strslicek  s�   ø€ Ø�!•�q•ˆAØ�!•ˆAØ�Q•4ˆDØ—;‘;˜q“>ˆDØœH‘5¨$¯+©+°a«.ˆDØ�qŒyØ˜”6˜aœhÙØ”6Ø�Kà #�:¨Õ,Ð,à—x‘x  t§{¡{°4Ó'8¸$Ð ?Ó@Ð@rl   ra  rb  r5  )rœ   rc  Úrowslicer‘   Úcolslice)rf   rÙ   rn  s   f& rj   Ú_print_MatrixSliceÚ#JuliaCodePrinter._print_MatrixSlicej  s|   ø€ õ	Að —‘˜DŸK™KÓ(¨3Õ.Ù˜Ÿ™¨¯©×(9Ñ(9¸!Õ(<Ó=õ>Ø@CõDá˜Ÿ™¨¯©×(9Ñ(9¸!Õ(<Ó=õ>à@CõDð 	Erl   c                	óÖ   € VP                    Uu. uF  q P                  V4      NK  	  ppV P                  VP                  P                  4      : R RP	                  V4      : R2# u upi )ra  rb  r5  )r¡   rœ   rÐ   r�   r6  )rf   rÙ   r�   Úindss   &&  rj   Ú_print_IndexedÚJuliaCodePrinter._print_Indexed  sI   € Ø)-¯ªÓ7© A—‘˜Q–©ˆÐ7ØŸ;™; t§y¡y§¡Ö7¸¿¹À$¾ÐHÐHùò 8s   �A&c                	óT   € R V P                  VP                  ^ ,          4      ,          # )zeye(%s))rœ   r‘   r  s   &&rj   Ú_print_IdentityÚ JuliaCodePrinter._print_Identityƒ  s   € Ø˜4Ÿ;™; t§z¡z°!¥}Ó5Õ5Ð5rl   c                	ó”   € R P                  VP                   Uu. uF  pV P                  V\        V4      4      NK   	  up4      # u upi )z .* )r6  rÑ   rÖ   r   )rf   rÙ   Úargs   && rj   Ú_print_HadamardProductÚ'JuliaCodePrinter._print_HadamardProduct†  sI   € Ø�{‰{Ø%)§Y¢Yó0Ù%.˜cð !×-Ñ-¨c´:¸dÓ3CÖDÙ%.ñ0ó 1ð 	1ùò 0s   š$Ac                	ó¦   € \        V4      pR P                  V P                  VP                  V4      V P                  VP                  V4      .4      # )z.**)r   r6  rÖ   rÐ   r+   rø   s   && rj   Ú_print_HadamardPowerÚ%JuliaCodePrinter._print_HadamardPowerŠ  sJ   € Ü˜$ÓˆØ�z‰zØ×Ñ˜dŸi™i¨Ó.Ø×Ñ˜dŸh™h¨Ó-ðó ð 	rl   c                	óˆ   € VP                   ^8X  d   \        VP                  4      # VP                  : RVP                   : 2# )r—   z // )rÔ   rF  rp   r  s   &&rj   Ú_print_RationalÚ JuliaCodePrinter._print_Rational‘  s.   € Ø�6‰6�QŒ;Ü�t—v‘v“;ÐØ!ŸVœV T§V£VÐ,Ð,rl   c                	óî   € ^ RI HpHp VP                  pV! \        P
                  ^V,          ,          4      V! VP                  \        P                  ,           V4      ,          pV P                  V4      # )rª   )r-   r;   )	Úsympy.functionsr-   r;   Úargumentr   ÚPirÉ   ÚHalfrœ   )rf   rÙ   r-   r;   rà   Úexpr2s   &&    rj   Ú	_print_jnÚJuliaCodePrinter._print_jn—  óL   € ß1Ø�M‰MˆÙ”Q—T‘T˜1˜Q�3•ZÓ ¡¨¯©´a·f±fÕ)<¸aÓ!@Õ@ˆØ�{‰{˜5Ó!Ð!rl   c                	óî   € ^ RI HpHp VP                  pV! \        P
                  ^V,          ,          4      V! VP                  \        P                  ,           V4      ,          pV P                  V4      # )rª   )r-   r<   )	r†  r-   r<   r‡  r   rˆ  rÉ   r‰  rœ   )rf   rÙ   r-   r<   rà   rŠ  s   &&    rj   Ú	_print_ynÚJuliaCodePrinter._print_ynž  r�  rl   c                	óŽ   € R P                  V P                  VP                  ^ ,          \        P                  ,          4      4      # )zsinc({}))ry   rœ   rÑ   r   rˆ  r  s   &&rj   Ú_print_sincÚJuliaCodePrinter._print_sinc¤  s-   € à× Ñ  §¡¨T¯Y©Y°q­\¼A¿D¹DÕ-@Ó!AÓBÐBrl   c           
     	ó$  € VP                   R,          P                  R8w  d   \        R4      h. pV P                  R,          '       d¬   VP                   RR  UUu. uF5  w  r4RP	                  V P                  V4      V P                  V4      4      NK7  	  pppRV P                  VP                   R,          P                  4      ,          pRP                  V4      V,           pRV,           R	,           # \        VP                   4       Fî  w  pw  r4V^ 8X  d)   VP                  R
V P                  V4      ,          4       MaV\        VP                   4      ^,
          8X  d   VR8X  d   VP                  R4       M'VP                  RV P                  V4      ,          4       V P                  V4      p	VP                  V	4       V\        VP                   4      ^,
          8X  g   KÝ  VP                  R4       Kð  	  RP                  V4      # u uppi )r—   Tz¼All Piecewise expressions must contain an (expr, True) statement to be used as a default condition. Without one, the generated expression may not evaluate to anything under some condition.rZ   Nz({}) ? ({}) :z (%s)Ú
Ú(rÁ   zif (%s)Úelsezelseif (%s)rš   rÄ   )rÑ   ÚcondÚ
ValueErrorrþ   ry   rœ   rÙ   r6  Ú	enumerater    r²   )
rf   rÙ   r…   rÜ   rÛ   ÚecpairsÚelastÚpwr�   Úcode0s
   &&        rj   Ú_print_PiecewiseÚ!JuliaCodePrinter._print_Piecewise¨  sŸ  € Ø�9‰9�R�=×Ñ Ô%ô ð /ó 0ð 0ð
 ˆØ�>‰>˜(×#Ô#ð $(§9¡9¨S¨b¡>ô3á#1™4˜1ð '×-Ñ-ØŸ™ A›¨¯©°A«ö8á#1ð ñ 3ð ˜dŸk™k¨$¯)©)°B­-×*<Ñ*<Ó=Õ=ˆEØ—‘˜7Ó# eÕ+ˆBð ˜•8˜c•>Ð!ä& t§y¡yÖ1‘	�‘6�AØ˜”6Ø—L‘L ¨T¯[©[¸«^Õ!;Õ<Øœ#˜dŸi™i›.¨1Õ,Ô,°°d´Ø—L‘L Õ(à—L‘L °·±¸Q³Õ!?Ô@ØŸ™ A›�Ø—‘˜UÔ#Øœ˜DŸI™I›¨Õ*Ö*Ø—L‘L Ö'ñ 2ð —9‘9˜UÓ#Ð#ùó)3s   Á;Hc                	óž  a a€ SP                  4       w  r#R pVP                  '       dz   VP                  4       w  rVVP                  '       d#   VP                  '       d   \        V) V4      oRpM3VP                  '       d"   VP                  '       d   \        V) V4      oRpVRP                  VV 3R lSP                   4       4      ,           # )r¬   r«   z * c              3  óZ   <"  € T F   pSP                  V\        S4      4      x € K"  	  R # 5irƒ   )rÖ   r   )r‹   r|  rÙ   rf   s   & €€rj   r�   Ú1JuliaCodePrinter._print_MatMul.<locals>.<genexpr>Ú  s&   øé € ÐKÁ¸#ˆT×Ñ˜s¤J¨tÓ$4×5Ð5Ãùs   ƒ(+)Úas_coeff_mmulr³   Úas_real_imagÚis_zerorÏ   r   r6  rÑ   )rf   rÙ   rÛ   Úmr(   rM   rK   s   ff     rj   Ú_print_MatMulÚJuliaCodePrinter._print_MatMulÌ  s›   ù€ Ø×!Ñ!Ó#‰ˆàˆØ�;�;ˆ;Ø—^‘^Ó%‰FˆBØ�z�zˆz˜bŸnŸn˜nÜ" A 2 qÓ)�Ø‘Ø——� §§ Ü" A 2 qÓ)�Ø�à�e—j‘jÝKÀÇÂÓKó
õ 
ð 	
rl   c           	     ó&  a€ \        V\        4      '       d2   V P                  VP                  R4      4      pRP	                  V4      # RpRpR	pV Uu. uF  qfP                  R4      NK  	  ppV Uau. uFF  o\        \        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      4      NKH  	  ppV Uau. uFF  o\        \        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      4      NKH  	  pp. p	^ p
\        V4       F[  w  poSR
9   d   V	P                  S4       K   W¨V,          ,          p
V	P                  W:,          : S: 24       W§V,          ,          p
K]  	  V	# u upi u upi u upi )z0Accepts a string of code or a list of code linesTr¬   z    z 	c              3  ó<   <"  € T F  p\        VS4      x € K  	  R # 5irƒ   r   ©r‹   rM   Úlines   & €rj   r�   Ú/JuliaCodePrinter.indent_code.<locals>.<genexpr>í  ó   øé € ÐB¹	°"œV B¨×-Ð-»	ùó   ƒFc              3  ó<   <"  € T F  p\        VS4      x € K  	  R # 5irƒ   r   r¬  s   & €rj   r�   r®  ï  r¯  r°  )z
^function z^if ú^elseif ú^else$z^for )z^end$r²  r³  )r¬   r•  )
rÒ   rF  r„   Ú
splitlinesr6  ÚlstripÚintÚanyrš  r    )rf   ÚcodeÚ
code_linesÚtabÚ	inc_regexÚ	dec_regexr­  ÚincreaseÚdecreaseÚprettyÚlevelÚns   &&    `     rj   r„   ÚJuliaCodePrinter.indent_codeÞ  s`  ø€ ô �dœC× Ò Ø×)Ñ)¨$¯/©/¸$Ó*?Ó@ˆJØ—7‘7˜:Ó&Ð&àˆØIˆ	Ø3ˆ	ñ 15Ó6±¨—‘˜UÖ#±ˆÐ6ñ "&ô(Ù!%˜ô Ÿ›ÔB¹	ÓBŸŸšÔB¹	ÓBÓBÖCÙ!%ð 	ð (ñ "&ô(Ù!%˜ô Ÿ›ÔB¹	ÓBŸŸšÔB¹	ÓBÓBÖCÙ!%ð 	ð (ð ˆØˆÜ  –‰GˆAˆtØ�zÔ!Ø—‘˜dÔ#ÙØ˜a•[Õ ˆEØ�M‰M C§IªtÐ4Ô5Ø˜a•[Õ ŠEñ 'ð ˆùò! 7ùò(ùò(s   ÁFÁ3)F	Â F	Ã)FÃ2 F)rb   )9Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚprintmethodÚlanguageÚ
_operatorsr_   r
   r[   Ú__annotations__r^   rq   ru   r{   r€   r†   r”   r§   rã   rì   rõ   rù   r  r  r  r  r  r  r"  r&  r*  r/  r7  r;  Ú_print_Tupler?  rC  rG  rQ  r\  rd  rr  rv  ry  r}  r€  rƒ  r‹  r�  r’  rŸ  r¨  r„   Ú__static_attributes__Ú__classcell__)ri   s   @rj   rP   rP   0   sU  ø‡ ñð €KØ€Hð 	ˆtØˆdØˆsð€Jñ )-¨[×-JÑ-Jñ )Ø�RØ˜"Ø�DØ�$ð	Oñ )Ð�~ó ð !#÷ /òò!ò#ò3ò'òBò	'òHZòT9ò>ò(=õ5òõ5õ5õ5õ5òIò:òòòFò7ð
  €Lòòò!ò:òNò3ò
Eò*Iò6ò1òò-ò"ò"òCò"$òH
÷$ð rl   rP   Nc                ó6   € \        V4      P                  W4      # )am  Converts `expr` to a string of Julia code.

Parameters
==========

expr : Expr
    A SymPy expression to be converted.
assign_to : optional
    When given, the argument is used as the name of the variable to which
    the expression is assigned.  Can be a string, ``Symbol``,
    ``MatrixSymbol``, or ``Indexed`` type.  This can be helpful for
    expressions that generate multi-line statements.
precision : integer, optional
    The precision for numbers such as pi  [default=16].
user_functions : dict, optional
    A dictionary where keys are ``FunctionClass`` instances and values are
    their string representations.  Alternatively, the dictionary value can
    be a list of tuples i.e. [(argument_test, cfunction_string)].  See
    below for examples.
human : bool, optional
    If True, the result is a single string that may contain some constant
    declarations for the number symbols.  If False, the same information is
    returned in a tuple of (symbols_to_declare, not_supported_functions,
    code_text).  [default=True].
contract: bool, optional
    If True, ``Indexed`` instances are assumed to obey tensor contraction
    rules and the corresponding nested loops over indices are generated.
    Setting contract=False will not generate loops, instead the user is
    responsible to provide values for the indices in the code.
    [default=True].
inline: bool, optional
    If True, we try to create single-statement code instead of multiple
    statements.  [default=True].

Examples
========

>>> from sympy import julia_code, symbols, sin, pi
>>> x = symbols('x')
>>> julia_code(sin(x).series(x).removeO())
'x .^ 5 / 120 - x .^ 3 / 6 + x'

>>> from sympy import Rational, ceiling
>>> x, y, tau = symbols("x, y, tau")
>>> julia_code((2*tau)**Rational(7, 2))
'8 * sqrt(2) * tau .^ (7 // 2)'

Note that element-wise (Hadamard) operations are used by default between
symbols.  This is because its possible in Julia to write "vectorized"
code.  It is harmless if the values are scalars.

>>> julia_code(sin(pi*x*y), assign_to="s")
's = sin(pi * x .* y)'

If you need a matrix product "*" or matrix power "^", you can specify the
symbol as a ``MatrixSymbol``.

>>> from sympy import Symbol, MatrixSymbol
>>> n = Symbol('n', integer=True, positive=True)
>>> A = MatrixSymbol('A', n, n)
>>> julia_code(3*pi*A**3)
'(3 * pi) * A ^ 3'

This class uses several rules to decide which symbol to use a product.
Pure numbers use "*", Symbols use ".*" and MatrixSymbols use "*".
A HadamardProduct can be used to specify componentwise multiplication ".*"
of two MatrixSymbols.  There is currently there is no easy way to specify
scalar symbols, so sometimes the code might have some minor cosmetic
issues.  For example, suppose x and y are scalars and A is a Matrix, then
while a human programmer might write "(x^2*y)*A^3", we generate:

>>> julia_code(x**2*y*A**3)
'(x .^ 2 .* y) * A ^ 3'

Matrices are supported using Julia inline notation.  When using
``assign_to`` with matrices, the name can be specified either as a string
or as a ``MatrixSymbol``.  The dimensions must align in the latter case.

>>> from sympy import Matrix, MatrixSymbol
>>> mat = Matrix([[x**2, sin(x), ceiling(x)]])
>>> julia_code(mat, assign_to='A')
'A = [x .^ 2 sin(x) ceil(x)]'

``Piecewise`` expressions are implemented with logical masking by default.
Alternatively, you can pass "inline=False" to use if-else conditionals.
Note that if the ``Piecewise`` lacks a default term, represented by
``(expr, True)`` then an error will be thrown.  This is to prevent
generating an expression that may not evaluate to anything.

>>> from sympy import Piecewise
>>> pw = Piecewise((x + 1, x > 0), (x, True))
>>> julia_code(pw, assign_to=tau)
'tau = ((x > 0) ? (x + 1) : (x))'

Note that any expression that can be generated normally can also exist
inside a Matrix:

>>> mat = Matrix([[x**2, pw, sin(x)]])
>>> julia_code(mat, assign_to='A')
'A = [x .^ 2 ((x > 0) ? (x + 1) : (x)) sin(x)]'

Custom printing can be defined for certain types by passing a dictionary of
"type" : "function" to the ``user_functions`` kwarg.  Alternatively, the
dictionary value can be a list of tuples i.e., [(argument_test,
cfunction_string)].  This can be used to call a custom Julia function.

>>> from sympy import Function
>>> f = Function('f')
>>> g = Function('g')
>>> custom_functions = {
...   "f": "existing_julia_fcn",
...   "g": [(lambda x: x.is_Matrix, "my_mat_fcn"),
...         (lambda x: not x.is_Matrix, "my_fcn")]
... }
>>> mat = Matrix([[1, x]])
>>> julia_code(f(x) + g(x) + g(mat), user_functions=custom_functions)
'existing_julia_fcn(x) + my_fcn(x) + my_mat_fcn([1 x])'

Support for loops is provided through ``Indexed`` types. With
``contract=True`` these expressions will be turned into loops, whereas
``contract=False`` will just print the assignment expression that should be
looped over:

>>> from sympy import Eq, IndexedBase, Idx
>>> len_y = 5
>>> y = IndexedBase('y', shape=(len_y,))
>>> t = IndexedBase('t', shape=(len_y,))
>>> Dy = IndexedBase('Dy', shape=(len_y-1,))
>>> i = Idx('i', len_y-1)
>>> e = Eq(Dy[i], (y[i+1]-y[i])/(t[i+1]-t[i]))
>>> julia_code(e.rhs, assign_to=e.lhs, contract=False)
'Dy[i] = (y[i + 1] - y[i]) ./ (t[i + 1] - t[i])'
)rP   Údoprint)rÙ   Ú	assign_torg   s   &&,rj   Ú
julia_coderÒ  þ  s   € ôL ˜HÓ%×-Ñ-¨dÓ>Ð>rl   c                ó0   € \        \        V 3/ VB 4       R# )zvPrints the Julia representation of the given expression.

See `julia_code` for the meaning of the optional arguments.
N)ÚprintrÒ  )rÙ   rg   s   &,rj   Úprint_julia_coderÕ  ‡  s   € ô
 
Œ*�TÑ
&˜XÑ
&Ö'rl   rƒ   )rÇ  Ú
__future__r   Útypingr   Ú
sympy.corer   r   r   r   Úsympy.core.mulr   Úsympy.core.numbersr	   Úsympy.printing.codeprinterr
   Úsympy.printing.precedencer   r   rM   r   ra   rd   rP   rÒ  rÕ  ro   rl   rj   Ú<module>rÝ     sB  ðñ	õ #Ý ç ,Ó ,Ý &Ý +Ý 2ß <Ý ð
(�5ð 
(˜%ð 
( ð 
(¨ð 
(¨uð 
(°eð 
(Øð
(Ø!ð
(Ø#)ð
(Ø+1ð
(Ø39ð
(Ø;Að
(àð
(à!ð
(à#)ð
(à+1ð
(à39ð
(à;Að
(ð ð
(ð $ð
(ð &-ð
(ð /6ð
(ð 8?ð
(ð AHð
(ð ð	
(ð #ð	
(ð %,ð	
(ð .3ð	
(ð 5:ð	
(ð
 ð
(ð
 "ð
(ð
 $)ð
(ð
 +1ð
(ð
 39ð
(ð ð
(ð !(ð
(ð *3ð
(ð 5?ð
(ð ð
(ð !'ð
(ð ð
(ð +ð
(ð -5ð
(ð 7Dð
(ð ð
(ð (ð
(ð *3ð
(ð 5>ð
(ð ð
(ð 'ð
(€ð 
ˆ5ØˆvØ�ØˆzØˆzØˆ&Øˆ&ð€ôK�{ô Kô\F?ôR(rl   