§
    OŠtjøI  ã                  ób  — d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
mZmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZmZ dd	lmZ dd
lmZ ddlmZmZ ddlm Z   ed¦  «        Z! ed¦  «        Z" ed¦  «        Z# ed¦  «        Z$ ed¦  «        Z% ed¦  «        Z& G d„ de
¦  «        Z' G d„ de
¦  «        Z(d„ Z) G d„ de
¦  «        Z* G d„ de
¦  «        Z+ G d„ de¦  «        Z, G d„ de
¦  «        Z- G d „ d!e
¦  «        Z. G d"„ d#e
¦  «        Z/ G d$„ d%e
¦  «        Z0 G d&„ d'e¦  «        Z1 e1¦   «         Z2d(„ Z3 e3d)¦  «        Z4dRd+d*d*d,œd-„Z5d.„ Z6d/„ Z7dSd0„Z8dSd1„Z9dRd2„Z:dSd3„Z;dSd4„Z<dRd5„Z= G d6„ d7e
¦  «        Z> G d8„ d9e
¦  «        Z? G d:„ d;e¦  «        Z@ G d<„ d=e@¦  «        ZA G d>„ d?e@¦  «        ZB G d@„ dAe@¦  «        ZC G dB„ dCe@¦  «        ZD G dD„ dEe@¦  «        ZE G dF„ dGeA¦  «        ZF G dH„ dIe¦  «        ZG G dJ„ dKeG¦  «        ZH G dL„ dMeG¦  «        ZI G dN„ dOe
e¦  «        ZJ G dP„ dQe
e¦  «        ZKd*S )Tz¬
AST nodes specific to Fortran.

The functions defined in this module allows the user to express functions such as ``dsign``
as a SymPy function for symbolic manipulation.
é    )Úannotations)	Ú	AttributeÚ	CodeBlockÚFunctionCallÚNodeÚnoneÚStringÚTokenÚ	_mk_TupleÚVariable)ÚBasic©ÚTuple)ÚExpr)ÚFunction)ÚFloatÚInteger)ÚStr)Úsympify©ÚtrueÚfalse)ÚiterableÚpureÚ	elementalÚ	intent_inÚ
intent_outÚintent_inoutÚallocatablec                  ó6   — e Zd ZdZdxZZeZ ed„ ¦  «        Z	dS )ÚProgramaf   Represents a 'program' block in Fortran.

    Examples
    ========

    >>> from sympy.codegen.ast import Print
    >>> from sympy.codegen.fnodes import Program
    >>> prog = Program('myprogram', [Print([42])])
    >>> from sympy import fcode
    >>> print(fcode(prog, source_format='free'))
    program myprogram
        print *, 42
    end program

    )ÚnameÚbodyc                ó   — t          | Ž S ©N©r   ©r#   s    úR/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/codegen/fnodes.pyú<lambda>zProgram.<lambda>4   ó   € µ	¸4Ð0@€ ó    N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Ú_fieldsr	   Ú_construct_nameÚstaticmethodÚ_construct_body© r+   r(   r!   r!   "   s<   € € € € € ðð ð +Ð*€I�Ø€OØ"�lÐ#@Ð#@ÑAÔA€O€O€Or+   r!   c                  ó"   — e Zd ZdZdxZZeZeZdS )Ú
use_renameaÊ   Represents a renaming in a use statement in Fortran.

    Examples
    ========

    >>> from sympy.codegen.fnodes import use_rename, use
    >>> from sympy import fcode
    >>> ren = use_rename("thingy", "convolution2d")
    >>> print(fcode(ren, source_format='free'))
    thingy => convolution2d
    >>> full = use('signallib', only=['snr', ren])
    >>> print(fcode(full, source_format='free'))
    use signallib, only: snr, thingy => convolution2d

    )ÚlocalÚoriginalN)	r,   r-   r.   r/   r0   r1   r	   Ú_construct_localÚ_construct_originalr5   r+   r(   r7   r7   7   s2   € € € € € ðð ð 0Ð/€I�ØÐØ ÐÐÐr+   r7   c                óN   — t          | d¦  «        r| j        S t          | ¦  «        S )Nr"   )Úhasattrr"   r	   ©Úargs    r(   Ú_namer@   K   s'   € Ýˆs�FÑÔð ØŒxˆå�c‰{Œ{Ðr+   c                  ój   — e Zd ZdZdxZZeedœZ ee	¦  «        Z
 ed„ ¦  «        Z ed„ ¦  «        ZdS )ÚuseaÑ   Represents a use statement in Fortran.

    Examples
    ========

    >>> from sympy.codegen.fnodes import use
    >>> from sympy import fcode
    >>> fcode(use('signallib'), source_format='free')
    'use signallib'
    >>> fcode(use('signallib', [('metric', 'snr')]), source_format='free')
    'use signallib, metric => snr'
    >>> fcode(use('signallib', only=['snr', 'convolution2d']), source_format='free')
    'use signallib, only: snr, convolution2d'

    )Ú	namespaceÚrenameÚonly)rD   rE   c                ó(   — t          d„ | D ¦   «         Ž S )Nc                óN   — g | ]"}t          |t          ¦  «        r|nt          |Ž ‘Œ#S r5   )Ú
isinstancer7   ©Ú.0r?   s     r(   ú
<listcomp>z use.<lambda>.<locals>.<listcomp>d   sF   € ð  :Dð  :Dð  :DÐwzÅÈCÕQ[ÑA\ÔA\Ð:r¸#¸#ÕblÐnqÐbrð  :Dð  :Dð  :Dr+   r   ©Úargss    r(   r)   zuse.<lambda>d   s1   € µ%ð  :Dð  :Dð  Cð  :Dñ  :Dô  :Dð  3E€ r+   c                ó(   — t          d„ | D ¦   «         Ž S )Nc                óZ   — g | ](}t          |t          ¦  «        r|nt          |¦  «        ‘Œ)S r5   )rH   r7   r@   rI   s     r(   rK   z use.<lambda>.<locals>.<listcomp>e   s6   € Ð7{Ð7{Ð7{Ðor½zÈ#ÍzÑ?ZÔ?ZÐ8j¸¸Õ`eÐfiÑ`jÔ`jÐ7{Ð7{Ð7{r+   r   rL   s    r(   r)   zuse.<lambda>e   s   € µÐ7{Ð7{ÐvzÐ7{Ñ7{Ô7{Ð0|€ r+   N)r,   r-   r.   r/   r0   r1   r   Údefaultsr3   r@   Ú_construct_namespaceÚ_construct_renameÚ_construct_onlyr5   r+   r(   rB   rB   Q   st   € € € € € ðð ð :Ð9€I�Ø¨Ð-Ð-€HØ'˜<¨Ñ.Ô.ÐØ$˜ð  &Eð  &Eñ  Fô  FÐØ"�lÐ#|Ð#|Ñ}Ô}€O€O€Or+   rB   c                  ód   — e Zd ZdZdxZZd e¦   «         iZeZ	e
d„ ¦   «         Z ed„ ¦  «        ZdS )ÚModulea\   Represents a module in Fortran.

    Examples
    ========

    >>> from sympy.codegen.fnodes import Module
    >>> from sympy import fcode
    >>> print(fcode(Module('signallib', ['implicit none'], []), source_format='free'))
    module signallib
    implicit none
    <BLANKLINE>
    contains
    <BLANKLINE>
    <BLANKLINE>
    end module

    )r"   ÚdeclarationsÚdefinitionsrV   c                ó,   — d„ |D ¦   «         }t          |Ž S )Nc                óZ   — g | ](}t          |t          ¦  «        rt          |¦  «        n|‘Œ)S r5   )rH   Ústrr   rI   s     r(   rK   z2Module._construct_declarations.<locals>.<listcomp>€   s1   € ÐJÐJÐJ¸c�J s­CÑ0Ô0Ð9•�C‘”�°cÐJÐJÐJr+   r&   )ÚclsrM   s     r(   Ú_construct_declarationszModule._construct_declarations~   s    € àJÐJÀTÐJÑJÔJˆÝ˜$ÐÐr+   c                ó   — t          | Ž S r%   r&   r>   s    r(   r)   zModule.<lambda>ƒ   s
   € µiÀ°o€ r+   N)r,   r-   r.   r/   r0   r1   r   rP   r	   r2   Úclassmethodr\   r3   Ú_construct_definitionsr5   r+   r(   rU   rU   h   sk   € € € € € ðð ð" BÐA€I�Ø  ¡¤Ð(€HØ€Oàð ð  ñ „[ð ð *˜\Ð*EÐ*EÑFÔFÐÐÐr+   rU   c                  ó\   — e Zd ZdZdZeej        z   ZeZ e	d„ ¦  «        Z
ed„ ¦   «         ZdS )Ú
Subroutineaê   Represents a subroutine in Fortran.

    Examples
    ========

    >>> from sympy import fcode, symbols
    >>> from sympy.codegen.ast import Print
    >>> from sympy.codegen.fnodes import Subroutine
    >>> x, y = symbols('x y', real=True)
    >>> sub = Subroutine('mysub', [x, y], [Print([x**2 + y**2, x*y])])
    >>> print(fcode(sub, source_format='free', standard=2003))
    subroutine mysub(x, y)
    real*8 :: x
    real*8 :: y
    print *, x**2 + y**2, x*y
    end subroutine

    )r"   Ú
parametersr#   c                óD   — t          t          t          j        | ¦  «        Ž S r%   )r   Úmapr   Údeduced)Úparamss    r(   r)   zSubroutine.<lambda>œ   s   € ½½sÅ8ÔCSÐU[Ñ?\Ô?\Ð8]€ r+   c                óB   — t          |t          ¦  «        r|S t          |Ž S r%   )rH   r   )r[   Úitrs     r(   r4   zSubroutine._construct_bodyž   s#   € å�c�9Ñ%Ô%ð 	#ØˆJå˜c�?Ð"r+   N)r,   r-   r.   r/   r0   r   r1   r	   r2   r3   Ú_construct_parametersr^   r4   r5   r+   r(   ra   ra   †   sc   € € € € € ðð ð$ /€IØ˜$œ,Ñ&€GØ€OØ(˜LÐ)]Ð)]Ñ^Ô^Ðàð#ð #ñ „[ð#ð #ð #r+   ra   c                  óF   — e Zd ZdZdxZZ ee¦  «        Z ee	¦  «        Z
dS )ÚSubroutineCallzü Represents a call to a subroutine in Fortran.

    Examples
    ========

    >>> from sympy.codegen.fnodes import SubroutineCall
    >>> from sympy import fcode
    >>> fcode(SubroutineCall('mysub', 'x y'.split()))
    '       call mysub(x, y)'

    )r"   Úsubroutine_argsN)r,   r-   r.   r/   r0   r1   r3   r@   r2   r   Ú_construct_subroutine_argsr5   r+   r(   rk   rk   ¥   sE   € € € € € ð
ð 
ð 6Ð5€I�Ø"�l 5Ñ)Ô)€OØ!- ¨iÑ!8Ô!8ÐÐÐr+   rk   c                  ó¾   — e Zd ZdZdxZZ ed¦  «        edœZ e	d„ ¦  «        Z
 e	e¦  «        Z e	e¦  «        Z e	e¦  «        Z e	e¦  «        Z e	d„ ¦  «        ZdS )ÚDoa�   Represents a Do loop in in Fortran.

    Examples
    ========

    >>> from sympy import fcode, symbols
    >>> from sympy.codegen.ast import aug_assign, Print
    >>> from sympy.codegen.fnodes import Do
    >>> i, n = symbols('i n', integer=True)
    >>> r = symbols('r', real=True)
    >>> body = [aug_assign(r, '+', 1/i), Print([i, r])]
    >>> do1 = Do(body, i, 1, n)
    >>> print(fcode(do1, source_format='free'))
    do i = 1, n
        r = r + 1d0/i
        print *, i, r
    end do
    >>> do2 = Do(body, i, 1, n, 2)
    >>> print(fcode(do2, source_format='free'))
    do i = 1, n, 2
        r = r + 1d0/i
        print *, i, r
    end do

    )r#   ÚcounterÚfirstÚlastÚstepÚ
concurrenté   )rs   rt   c                ó   — t          | Ž S r%   r&   r'   s    r(   r)   zDo.<lambda>Ó   r*   r+   c                ó"   — | rt           nt          S r%   r   r>   s    r(   r)   zDo.<lambda>Ø   s   € ¸SÐ5KµT°TÅe€ r+   N)r,   r-   r.   r/   r0   r1   r   r   rP   r3   r4   r   Ú_construct_counterÚ_construct_firstÚ_construct_lastÚ_construct_stepÚ_construct_concurrentr5   r+   r(   ro   ro   ¶   s¡   € € € € € ðð ð4 UÐT€I�Ø˜ ™
œ
°%Ð8Ð8€HØ"�lÐ#@Ð#@ÑAÔA€OØ%˜ gÑ.Ô.ÐØ#�| GÑ,Ô,ÐØ"�l 7Ñ+Ô+€OØ"�l 7Ñ+Ô+€OØ(˜LÐ)KÐ)KÑLÔLÐÐÐr+   ro   c                  ó0   — e Zd ZdZdxZZ ee¦  «        ZdS )ÚArrayConstructoraT   Represents an array constructor.

    Examples
    ========

    >>> from sympy import fcode
    >>> from sympy.codegen.fnodes import ArrayConstructor
    >>> ac = ArrayConstructor([1, 2, 3])
    >>> fcode(ac, standard=95, source_format='free')
    '(/1, 2, 3/)'
    >>> fcode(ac, standard=2003, source_format='free')
    '[1, 2, 3]'

    )ÚelementsN)	r,   r-   r.   r/   r0   r1   r3   r   Ú_construct_elementsr5   r+   r(   r~   r~   Û   s6   € € € € € ðð ð (Ð'€I�Ø&˜, yÑ1Ô1ÐÐÐr+   r~   c                  ó¢   — e Zd ZdZdxZZd ed¦  «        iZ ee	¦  «        Z
 ee	¦  «        Z ee	¦  «        Z ee	¦  «        Z ee	¦  «        ZdS )ÚImpliedDoLoopaÉ   Represents an implied do loop in Fortran.

    Examples
    ========

    >>> from sympy import Symbol, fcode
    >>> from sympy.codegen.fnodes import ImpliedDoLoop, ArrayConstructor
    >>> i = Symbol('i', integer=True)
    >>> idl = ImpliedDoLoop(i**3, i, -3, 3, 2)  # -27, -1, 1, 27
    >>> ac = ArrayConstructor([-28, idl, 28]) # -28, -27, -1, 1, 27, 28
    >>> fcode(ac, standard=2003, source_format='free')
    '[-28, (i**3, i = -3, 3, 2), 28]'

    )Úexprrp   rq   rr   rs   rs   ru   N)r,   r-   r.   r/   r0   r1   r   rP   r3   r   Ú_construct_exprrx   ry   rz   r{   r5   r+   r(   r‚   r‚   î   s„   € € € € € ðð ð GÐF€I�Ø˜˜ ™
œ
Ð#€HØ"�l 7Ñ+Ô+€OØ%˜ gÑ.Ô.ÐØ#�| GÑ,Ô,ÐØ"�l 7Ñ+Ô+€OØ"�l 7Ñ+Ô+€O€O€Or+   r‚   c                  ó   — e Zd ZdZd„ Zd„ ZdS )ÚExtentaC   Represents a dimension extent.

    Examples
    ========

    >>> from sympy.codegen.fnodes import Extent
    >>> e = Extent(-3, 3)  # -3, -2, -1, 0, 1, 2, 3
    >>> from sympy import fcode
    >>> fcode(e, source_format='free')
    '-3:3'
    >>> from sympy.codegen.ast import Variable, real
    >>> from sympy.codegen.fnodes import dimension, intent_out
    >>> dim = dimension(e, e)
    >>> arr = Variable('x', real, attrs=[dim, intent_out])
    >>> fcode(arr.as_Declaration(), source_format='free', standard=2003)
    'real*8, dimension(-3:3, -3:3), intent(out) :: x'

    c                ó8  — t          |¦  «        dk    r5|\  }}t          j        | t          |¦  «        t          |¦  «        ¦  «        S t          |¦  «        dk    st          |¦  «        dk    r|d         dv rt          j        | ¦  «        S t	          d¦  «        ‚)Né   r   ru   )ú:Nz5Expected 0 or 2 args (or one argument == None or ':'))Úlenr   Ú__new__r   Ú
ValueError)r[   rM   ÚlowÚhighs       r(   r‹   zExtent.__new__  s„   € Ýˆt‰9Œ9˜Š>ˆ>Ø‰IˆC�Ý”= ¥g¨c¡l¤lµG¸D±M´MÑBÔBÐBÝ�‰YŒY˜!Š^ˆ^¥ D¡	¤	¨Q¢ °4¸´7¸kÐ3IÐ3IÝ”= Ñ%Ô%Ð%åÐTÑUÔUÐUr+   c                ó~   — t          | j        ¦  «        dk    rdS d                     d„ | j        D ¦   «         ¦  «        S )Nr   r‰   c              3  ó4   K  — | ]}t          |¦  «        V — Œd S r%   )rZ   rI   s     r(   ú	<genexpr>z#Extent._sympystr.<locals>.<genexpr>%  s(   è è € Ð6Ð6 S�˜C™œÐ6Ð6Ð6Ð6Ð6Ð6r+   )rŠ   rM   Újoin)ÚselfÚprinters     r(   Ú	_sympystrzExtent._sympystr"  s=   € ÝˆtŒy‰>Œ>˜QÒÐØ�3Ø�xŠxÐ6Ð6¨D¬IÐ6Ñ6Ô6Ñ6Ô6Ð6r+   N)r,   r-   r.   r/   r‹   r•   r5   r+   r(   r†   r†     s?   € € € € € ðð ð$Vð Vð Vð7ð 7ð 7ð 7ð 7r+   r†   c                 ój  — t          | ¦  «        dk    rt          d¦  «        ‚g }| D ]Û}t          |t          ¦  «        r|                     |¦  «         Œ-t          |t
          ¦  «        rK|dk    r"|                     t          ¦   «         ¦  «         Œj|                     t          |¦  «        ¦  «         Œ�t          |¦  «        r|                     t          |Ž ¦  «         Œ¹|                     t          |¦  «        ¦  «         ŒÜt          | ¦  «        dk    rt          d¦  «        ‚t          d|¦  «        S )aú   Creates a 'dimension' Attribute with (up to 7) extents.

    Examples
    ========

    >>> from sympy import fcode
    >>> from sympy.codegen.fnodes import dimension, intent_in
    >>> dim = dimension('2', ':')  # 2 rows, runtime determined number of columns
    >>> from sympy.codegen.ast import Variable, integer
    >>> arr = Variable('a', integer, attrs=[dim, intent_in])
    >>> fcode(arr.as_Declaration(), source_format='free', standard=2003)
    'integer*4, dimension(2, :), intent(in) :: a'

    é   z0Fortran only supports up to 7 dimensional arraysr‰   r   zNeed at least one dimensionÚ	dimension)
rŠ   rŒ   rH   r†   ÚappendrZ   r	   r   r   r   )rM   rb   r?   s      r(   r˜   r˜   *  s&  € õ ˆ4�y„y�1‚}€}ÝÐKÑLÔLÐLØ€JØð ,ð ,ˆÝ�c�6Ñ"Ô"ð 
	,Ø×Ò˜cÑ"Ô"Ð"Ð"Ý˜�SÑ!Ô!ð 	,Ø�cŠzˆzØ×!Ò!¥&¡(¤(Ñ+Ô+Ð+Ð+à×!Ò!¥&¨¡+¤+Ñ.Ô.Ð.Ð.Ý�c‰]Œ]ð 	,Ø×Ò�f c˜lÑ+Ô+Ð+Ð+à×Ò�g c™lœlÑ+Ô+Ð+Ð+Ý
ˆ4�y„y�A‚~€~ÝÐ6Ñ7Ô7Ð7Ý�[ *Ñ-Ô-Ð-r+   Ú*Nr5   )ÚattrsÚvalueÚtypec               ó¼  — t          |t          ¦  «        r8t          |j        ¦  «        dk    rt	          dt          |¦  «        z  ¦  «        ‚n	t          |Ž }t          |¦  «        |gz   }|�F|t          t          t          fvrt          t          t          dœ|         }| 
                    |¦  «         |€t          j        | ||¬¦  «        S t          | |||¬¦  «        S )aë   Convenience function for creating a Variable instance for a Fortran array.

    Parameters
    ==========

    symbol : symbol
    dim : Attribute or iterable
        If dim is an ``Attribute`` it need to have the name 'dimension'. If it is
        not an ``Attribute``, then it is passed to :func:`dimension` as ``*dim``
    intent : str
        One of: 'in', 'out', 'inout' or None
    \*\*kwargs:
        Keyword arguments for ``Variable`` ('type' & 'value')

    Examples
    ========

    >>> from sympy import fcode
    >>> from sympy.codegen.ast import integer, real
    >>> from sympy.codegen.fnodes import array
    >>> arr = array('a', '*', 'in', type=integer)
    >>> print(fcode(arr.as_Declaration(), source_format='free', standard=2003))
    integer*4, dimension(*), intent(in) :: a
    >>> x = array('x', [3, ':', ':'], intent='out', type=real)
    >>> print(fcode(x.as_Declaration(value=1), source_format='free', standard=2003))
    real*8, dimension(3, :, :), intent(out) :: x = 1

    r˜   z/Got an unexpected Attribute argument as dim: %sN)ÚinÚoutÚinout)rœ   r›   )rH   r   rZ   r"   rŒ   r˜   Úlistr   r   r   r™   r   re   )ÚsymbolÚdimÚintentr›   rœ   r�   s         r(   Úarrayr¦   O  sÜ   € õ: �#•yÑ!Ô!ð ÝˆsŒx‰=Œ=˜KÒ'Ð'ÝÐNÕQTÐUXÑQYÔQYÑYÑZÔZÐZð (õ ˜ˆoˆå�‰KŒK˜3˜%Ñ€EØÐØ�)¥ZµÐ>Ð>Ð>Ý%­jÅ<ÐPÐPÐQWÔXˆFØ�Š�VÑÔÐØ€|ÝÔ ¨e¸5ÐAÑAÔAÐAå˜ ¨E¸Ð?Ñ?Ô?Ð?r+   c                óh   — t          | t          ¦  «        rt          | ¦  «        nt          | ¦  «        S r%   )rH   rZ   r	   r   r>   s    r(   Ú
_printabler¨   |  s'   € Ý$ S­#Ñ.Ô.Ð@�6�#‰;Œ;ˆ;µG¸C±L´LÐ@r+   c                ó>   — t          dt          | ¦  «        g¦  «        S )a   Creates an AST node for a function call to Fortran's "allocated(...)"

    Examples
    ========

    >>> from sympy import fcode
    >>> from sympy.codegen.fnodes import allocated
    >>> alloc = allocated('x')
    >>> fcode(alloc, source_format='free')
    'allocated(x)'

    Ú	allocated©r   r¨   )r¦   s    r(   rª   rª   €  s   € õ ˜¥j°Ñ&7Ô&7Ð%8Ñ9Ô9Ð9r+   c                ó’   — t          dt          | ¦  «        g|rt          |¦  «        gng z   |rt          |¦  «        gng z   ¦  «        S )ap   Creates an AST node for a function call to Fortran's "lbound(...)"

    Parameters
    ==========

    array : Symbol or String
    dim : expr
    kind : expr

    Examples
    ========

    >>> from sympy import fcode
    >>> from sympy.codegen.fnodes import lbound
    >>> lb = lbound('arr', dim=2)
    >>> fcode(lb, source_format='free')
    'lbound(arr, 2)'

    Úlboundr«   ©r¦   r¤   Úkinds      r(   r­   r­   �  s_   € õ( ØÝ	�EÑ	Ô	ÐØ!Ð	)�*�S‰/Œ/Ð	Ð	 rñ	+à#Ð	+�*�TÑ
Ô
Ð	Ð	¨ñ	-ñô ð r+   c                ó’   — t          dt          | ¦  «        g|rt          |¦  «        gng z   |rt          |¦  «        gng z   ¦  «        S )NÚuboundr«   r®   s      r(   r±   r±   ¬  s]   € ÝØÝ	�EÑ	Ô	ÐØ!Ð	)�*�S‰/Œ/Ð	Ð	 rñ	+à#Ð	+�*�TÑ
Ô
Ð	Ð	¨ñ	-ñô ð r+   c                óh   — t          dt          | ¦  «        g|rt          |¦  «        gng z   ¦  «        S )aR   Creates an AST node for a function call to Fortran's "shape(...)"

    Parameters
    ==========

    source : Symbol or String
    kind : expr

    Examples
    ========

    >>> from sympy import fcode
    >>> from sympy.codegen.fnodes import shape
    >>> shp = shape('x')
    >>> fcode(shp, source_format='free')
    'shape(x)'

    Úshaper«   )Úsourcer¯   s     r(   r³   r³   µ  sD   € õ& ØÝ	�FÑ	Ô	ÐØ#Ð	+�*�TÑ
Ô
Ð	Ð	¨ñ	-ñô ð r+   c                ó’   — t          dt          | ¦  «        g|rt          |¦  «        gng z   |rt          |¦  «        gng z   ¦  «        S )a…   Creates an AST node for a function call to Fortran's "size(...)"

    Examples
    ========

    >>> from sympy import fcode, Symbol
    >>> from sympy.codegen.ast import FunctionDefinition, real, Return
    >>> from sympy.codegen.fnodes import array, sum_, size
    >>> a = Symbol('a', real=True)
    >>> body = [Return((sum_(a**2)/size(a))**.5)]
    >>> arr = array(a, dim=[':'], intent='in')
    >>> fd = FunctionDefinition(real, 'rms', [arr], body)
    >>> print(fcode(fd, source_format='free', standard=2003))
    real*8 function rms(a)
    real*8, dimension(:), intent(in) :: a
    rms = sqrt(sum(a**2)*1d0/size(a))
    end function

    Úsizer«   r®   s      r(   r¶   r¶   Ï  s_   € õ( ØÝ	�EÑ	Ô	ÐØ!Ð	)�*�S‰/Œ/Ð	Ð	 rñ	+à#Ð	+�*�TÑ
Ô
Ð	Ð	¨ñ	-ñô ð r+   c                ó®   — t          dt          | ¦  «        t          |¦  «        g|rt          |¦  «        gng z   |rt          |¦  «        gng z   ¦  «        S )zž Creates an AST node for a function call to Fortran's "reshape(...)"

    Parameters
    ==========

    source : Symbol or String
    shape : ArrayExpr

    Úreshaper«   )r´   r³   ÚpadÚorders       r(   r¸   r¸   ë  si   € õ ØÝ	�FÑ	Ô	�Z¨Ñ.Ô.Ð/Ø!Ð	)�*�S‰/Œ/Ð	Ð	 rñ	+à #Ð	+�*�UÑ
Ô
Ð	Ð	¨ñ	-ñô ð r+   c                óF   — t          d| rt          | ¦  «        gng ¦  «        S )aú   Creates an Attribute ``bind_C`` with a name.

    Parameters
    ==========

    name : str

    Examples
    ========

    >>> from sympy import fcode, Symbol
    >>> from sympy.codegen.ast import FunctionDefinition, real, Return
    >>> from sympy.codegen.fnodes import array, sum_, bind_C
    >>> a = Symbol('a', real=True)
    >>> s = Symbol('s', integer=True)
    >>> arr = array(a, dim=[s], intent='in')
    >>> body = [Return((sum_(a**2)/s)**.5)]
    >>> fd = FunctionDefinition(real, 'rms', [arr, s], body, attrs=[bind_C('rms')])
    >>> print(fcode(fd, source_format='free', standard=2003))
    real*8 function rms(a, s) bind(C, name="rms")
    real*8, dimension(s), intent(in) :: a
    integer*4 :: s
    rms = sqrt(sum(a**2)/s)
    end function

    Úbind_C)r   r	   )r"   s    r(   r¼   r¼   ý  s%   € õ6 �X°Ð=¥ t¡¤˜~˜~¸2Ñ>Ô>Ð>r+   c                  óN   — e Zd ZdZdxZZdeiZ ee	¦  «        Z
 ee¦  «        ZdS )ÚGoToa    Represents a goto statement in Fortran

    Examples
    ========

    >>> from sympy.codegen.fnodes import GoTo
    >>> go = GoTo([10, 20, 30], 'i')
    >>> from sympy import fcode
    >>> fcode(go, source_format='free')
    'go to (10, 20, 30), i'

    )Úlabelsrƒ   rƒ   N)r,   r-   r.   r/   r0   r1   r   rP   r3   r   Ú_construct_labelsr   r„   r5   r+   r(   r¾   r¾     sL   € € € € € ðð ð -Ð,€I�Ø˜ˆ~€HØ$˜ YÑ/Ô/ÐØ"�l 7Ñ+Ô+€O€O€Or+   r¾   c                  ó8   — e Zd ZdZdxZZdeiZ ee	¦  «        Z
dS )ÚFortranReturnaK   AST node explicitly mapped to a fortran "return".

    Explanation
    ===========

    Because a return statement in fortran is different from C, and
    in order to aid reuse of our codegen ASTs the ordinary
    ``.codegen.ast.Return`` is interpreted as assignment to
    the result variable of the function. If one for some reason needs
    to generate a fortran RETURN statement, this node should be used.

    Examples
    ========

    >>> from sympy.codegen.fnodes import FortranReturn
    >>> from sympy import fcode
    >>> fcode(FortranReturn('x'))
    '       return x'

    )Úreturn_valuerÃ   N)r,   r-   r.   r/   r0   r1   r   rP   r3   r   Ú_construct_return_valuer5   r+   r(   rÂ   rÂ   -  s@   € € € € € ðð ð( ,Ð+€I�Ø Ð%€HØ*˜l¨7Ñ3Ô3ÐÐÐr+   rÂ   c                  ó   — e Zd ZdZd„ ZdS )Ú	FFunctionéM   c           	     óú   — | j         j        }|j        d         | j        k     rt	          d|| j        fz  ¦  «        ‚d                     |d                     t          |j        | j	        ¦  «        ¦  «        ¦  «        S )NÚstandardz%s requires Fortran %d or newerz{}({})z, )
Ú	__class__r,   Ú	_settingsÚ_required_standardÚNotImplementedErrorÚformatr’   rd   Ú_printrM   )r“   r”   r"   s      r(   Ú_fcodezFFunction._fcodeJ  sy   € ØŒ~Ô&ˆØÔ˜ZÔ(¨4Ô+BÒBÐBÝ%Ð&GØ'+¨TÔ-DÐ&Eñ'Fñ Gô Gð Gà�Š˜t T§Y¢Y­s°7´>À4Ä9Ñ/MÔ/MÑ%NÔ%NÑOÔOÐOr+   N)r,   r-   r.   rÌ   rÐ   r5   r+   r(   rÆ   rÆ   G  s.   € € € € € ØÐðPð Pð Pð Pð Pr+   rÆ   c                  ó   — e Zd ZdZdS )ÚF95Functioné_   N)r,   r-   r.   rÌ   r5   r+   r(   rÒ   rÒ   R  s   € € € € € ØÐÐÐr+   rÒ   c                  ó   — e Zd ZdZdZdS )Úisignz/ Fortran sign intrinsic for integer arguments. rˆ   N©r,   r-   r.   r/   Únargsr5   r+   r(   rÕ   rÕ   V  s   € € € € € Ø9Ð9Ø€E€E€Er+   rÕ   c                  ó   — e Zd ZdZdZdS )Údsignz8 Fortran sign intrinsic for double precision arguments. rˆ   NrÖ   r5   r+   r(   rÙ   rÙ   [  s   € € € € € ØBÐBØ€E€E€Er+   rÙ   c                  ó   — e Zd ZdZdZdS )Úcmplxz& Fortran complex conversion function. rˆ   NrÖ   r5   r+   r(   rÛ   rÛ   `  s   € € € € € Ø0Ð0Ø€E€E€Er+   rÛ   c                  ó   — e Zd ZdZdZdS )r¯   z Fortran kind function. ru   NrÖ   r5   r+   r(   r¯   r¯   e  ó   € € € € € Ø"Ð"Ø€E€E€Er+   r¯   c                  ó   — e Zd ZdZdZdS )Úmergez Fortran merge function é   NrÖ   r5   r+   r(   rß   rß   j  rÝ   r+   rß   c                  ó*   — e Zd ZU ded<   ded<   d„ ZdS )Ú_literalrZ   Ú_tokenÚintÚ	_decimalsc                ó>  — d                      | j        ¦  «        | z                       d¦  «        \  }}|                     d¦  «                             d¦  «        }|d         |dd …                              d¦  «        }}|dk    rdn|}|pd| j        z   |z   |pdz   S )	Nz%.{}eÚeÚ0ú.r   ru   ú+Ú )rÎ   rå   ÚsplitÚstripÚrstripÚlstriprã   )r“   r”   rM   ÚkwargsÚmantissaÚsgnd_exÚex_sgnÚex_nums           r(   rÐ   z_literal._fcodes  sŸ   € Ø$Ÿ^š^¨D¬NÑ;Ô;¸dÑB×IÒIÈ#ÑNÔNÑˆ�'Ø—>’> #Ñ&Ô&×-Ò-¨cÑ2Ô2ˆØ  œ W¨Q¨R¨R¤[×%7Ò%7¸Ñ%<Ô%<�ˆØ ’}�}��¨&ˆØ�˜C 4¤;Ñ.°Ñ7¸6¸=ÀSÑIÐIr+   N)r,   r-   r.   Ú__annotations__rÐ   r5   r+   r(   râ   râ   o  s<   € € € € € € Ø€K€K�KØ€N€N�NðJð Jð Jð Jð Jr+   râ   c                  ó   — e Zd ZdZdZdZdS )Ú
literal_spz' Fortran single precision real literal rç   é	   N©r,   r-   r.   r/   rã   rå   r5   r+   r(   r÷   r÷   {  s   € € € € € Ø1Ð1Ø€FØ€I€I€Ir+   r÷   c                  ó   — e Zd ZdZdZdZdS )Ú
literal_dpz' Fortran double precision real literal Údé   Nrù   r5   r+   r(   rû   rû   �  s   € € € € € Ø1Ð1Ø€FØ€I€I€Ir+   rû   c                  óL   — e Zd ZdxZZeedœZ ee¦  «        Z	 ee¦  «        Z
dS )Úsum_©r¦   r¤   Úmask©r¤   r  N©r,   r-   r.   r0   r1   r   rP   r3   r   Ú_construct_arrayÚ_construct_dimr5   r+   r(   rÿ   rÿ   ‡  óD   € € € € € Ø2Ð2€I�Ø TÐ*Ð*€HØ#�| GÑ,Ô,ÐØ!�\ 'Ñ*Ô*€N€N€Nr+   rÿ   c                  óL   — e Zd ZdxZZeedœZ ee¦  «        Z	 ee¦  «        Z
dS )Úproduct_r   r  Nr  r5   r+   r(   r  r  Ž  r  r+   r  r%   )NN)Lr/   Ú
__future__r   Úsympy.codegen.astr   r   r   r   r   r	   r
   r   r   Úsympy.core.basicr   Úsympy.core.containersr   Úsympy.core.exprr   Úsympy.core.functionr   Úsympy.core.numbersr   r   Úsympy.core.symbolr   Úsympy.core.sympifyr   Úsympy.logicr   r   Úsympy.utilities.iterablesr   r   r   r   r   r   r   r!   r7   r@   rB   rU   ra   rk   ro   r~   r‚   r†   Úassumed_extentr˜   Úassumed_sizer¦   r¨   rª   r­   r±   r³   r¶   r¸   r¼   r¾   rÂ   rÆ   rÒ   rÕ   rÙ   rÛ   r¯   rß   râ   r÷   rû   rÿ   r  r5   r+   r(   ú<module>r     sÌ  ððð ð #Ð "Ð "Ð "Ð "Ð "ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð #Ð "Ð "Ð "Ð "Ð "Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø  Ð  Ð  Ð  Ð  Ð  Ø (Ð (Ð (Ð (Ð (Ð (Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ø !Ð !Ð !Ð !Ð !Ð !Ø &Ð &Ð &Ð &Ð &Ð &Ø #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø .Ð .Ð .Ð .Ð .Ð .ð €y�ÑÔ€ØˆI�kÑ"Ô"€	àˆI�kÑ"Ô"€	ØˆY�|Ñ$Ô$€
Øˆy˜Ñ(Ô(€àˆi˜Ñ&Ô&€ðBð Bð Bð Bð Bˆeñ Bô Bð Bð*!ð !ð !ð !ð !�ñ !ô !ð !ð(ð ð ð~ð ~ð ~ð ~ð ~ˆ%ñ ~ô ~ð ~ð.Gð Gð Gð Gð GˆUñ Gô Gð Gð<#ð #ð #ð #ð #�ñ #ô #ð #ð>9ð 9ð 9ð 9ð 9�Uñ 9ô 9ð 9ð""Mð "Mð "Mð "Mð "Mˆñ "Mô "Mð "MðJ2ð 2ð 2ð 2ð 2�uñ 2ô 2ð 2ð&,ð ,ð ,ð ,ð ,�Eñ ,ô ,ð ,ð07ð 7ð 7ð 7ð 7ˆUñ 7ô 7ð 7ðB �‘”€ð .ð  .ð  .ðF ˆy˜‰~Œ~€ð+@¨R°tÀ$ð +@ð +@ð +@ð +@ð +@ðZAð Að Að:ð :ð :ð ð ð ð ð8ð ð ð ðð ð ð ð4ð ð ð ð8ð ð ð ð$?ð ?ð ?ð ?ð:,ð ,ð ,ð ,ð ,ˆ5ñ ,ô ,ð ,ð&4ð 4ð 4ð 4ð 4�Eñ 4ô 4ð 4ð4Pð Pð Pð Pð P�ñ Pô Pð Pðð ð ð ð �)ñ ô ð ðð ð ð ð ˆIñ ô ð ð
ð ð ð ð ˆIñ ô ð ð
ð ð ð ð ˆIñ ô ð ð
ð ð ð ð ˆ9ñ ô ð ð
ð ð ð ð ˆKñ ô ð ð
	Jð 	Jð 	Jð 	Jð 	Jˆuñ 	Jô 	Jð 	Jðð ð ð ð �ñ ô ð ðð ð ð ð �ñ ô ð ð+ð +ð +ð +ð +ˆ5�$ñ +ô +ð +ð+ð +ð +ð +ð +ˆu�dñ +ô +ð +ð +ð +r+   