Ë
    7^(høI  ã                  ó   — 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«      ZKy*)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                  ó.   — e Zd ZdZdxZZeZ ed„ «      Z	y)Ú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/skyplay_api_hub/venv/lib/python3.12/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Ù"Ñ#@ÓA�Or*   r    c                  ó    — e Zd ZdZdxZZeZeZy)Ú
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.   r/   r0   r	   Ú_construct_localÚ_construct_originalr4   r*   r'   r6   r6   7   s   „ ñð 0Ð/€I�ØÐØ Ñr*   r6   c                óH   — t        | d«      r| j                  S t        | «      S )Nr!   )Úhasattrr!   r	   ©Úargs    r'   Ú_namer?   K   s   € Üˆs�FÔØ�x‰xˆä�c‹{Ðr*   c                  óV   — e Zd ZdZdxZZeedœZ ee	«      Z
 ed„ «      Z ed„ «      Zy)Ú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)rC   rD   c           	     óh   — t        | D �cg c]  }t        |t        «      r|nt        |Ž ‘Œ c}Ž S c c}w r$   )r   Ú
isinstancer6   ©Úargsr>   s     r'   r(   zuse.<lambda>d   sA   € ´%ð  Cö  :DÐwzÄÈCÔQ[ÔA\¹#ÔblÐnqÐbrÑ:rò  :Dð  3E€ ùò  :Ds   Š!/c           	     ón   — t        | D �cg c]  }t        |t        «      r|n
t        |«      ‘Œ! c}Ž S c c}w r$   )r   rF   r6   r?   rG   s     r'   r(   zuse.<lambda>e   s0   € ´ÐvzÖ7{Ðor¼zÈ#ÌzÔ?Z¹Ô`eÐfiÓ`jÑ8jÒ7{Ð0|€ ùÒ7{s   Š$2N)r+   r,   r-   r.   r/   r0   r   Údefaultsr2   r?   Ú_construct_namespaceÚ_construct_renameÚ_construct_onlyr4   r*   r'   rA   rA   Q   sE   „ ñð :Ð9€I�Ø¨Ñ-€HÙ'¨Ó.ÐÙ$ñ  &Eó  FÐÙ"Ñ#|Ó}�Or*   rA   c                  óP   — e Zd ZdZdxZZd e«       iZeZ	e
d„ «       Z ed„ «      Zy)Ú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ÚdefinitionsrP   c                óp   — |D �cg c]  }t        |t        «      rt        |«      n|‘Œ! }}t        |Ž S c c}w r$   )rF   Ústrr   r   )ÚclsrH   r>   s      r'   Ú_construct_declarationszModule._construct_declarations~   s8   € àEIÖJ¸cœJ s¬CÔ0”�C”°cÑ9ÐJˆÐJÜ˜$ÐÐùò Ks   …$3c                ó   — t        | Ž S r$   r%   r=   s    r'   r(   zModule.<lambda>ƒ   s
   € ´iÀ°o€ r*   N)r+   r,   r-   r.   r/   r0   r   rJ   r	   r1   ÚclassmethodrU   r2   Ú_construct_definitionsr4   r*   r'   rO   rO   h   sE   „ ñð" BÐA€I�Ø¡£Ð(€HØ€Oàñ ó ð ñ *Ñ*EÓFÑr*   rO   c                  óX   — e Zd ZdZdZeej                  z   ZeZ e	d„ «      Z
ed„ «       Zy)Ú
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                óB   — t        t        t        j                  | «      Ž S r$   )r   Úmapr   Údeduced)Úparamss    r'   r(   zSubroutine.<lambda>œ   s   € ¼¼sÄ8×CSÑCSÐU[Ó?\Ð8]€ r*   c                ó6   — t        |t        «      r|S t        |Ž S r$   )rF   r   )rT   Úitrs     r'   r3   zSubroutine._construct_bodyž   s   € ä�cœ9Ô%ØˆJä˜c�?Ð"r*   N)r+   r,   r-   r.   r/   r   r0   r	   r1   r2   Ú_construct_parametersrW   r3   r4   r*   r'   rZ   rZ   †   s?   „ ñð$ /€IØ˜$Ÿ,™,Ñ&€GØ€OÙ(Ñ)]Ó^Ðàñ#ó ñ#r*   rZ   c                  ó8   — e Zd ZdZdxZZ ee«      Z ee	«      Z
y)Ú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.   r/   r0   r2   r?   r1   r   Ú_construct_subroutine_argsr4   r*   r'   rd   rd   ¥   s(   „ ñ
ð 6Ð5€I�Ù" 5Ó)€OÙ!-¨iÓ!8Ñr*   rd   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y)Ú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é   )rl   rm   c                ó   — t        | Ž S r$   r%   r&   s    r'   r(   zDo.<lambda>Ó   r)   r*   c                ó   — | rt         S t        S r$   r   r=   s    r'   r(   zDo.<lambda>Ø   s   € ¹S´T€ Äe€ r*   N)r+   r,   r-   r.   r/   r0   r   r   rJ   r2   r3   r   Ú_construct_counterÚ_construct_firstÚ_construct_lastÚ_construct_stepÚ_construct_concurrentr4   r*   r'   rh   rh   ¶   sc   „ ñð4 UÐT€I�Ù ›
°%Ñ8€HÙ"Ñ#@ÓA€OÙ% gÓ.ÐÙ# GÓ,ÐÙ" 7Ó+€OÙ" 7Ó+€OÙ(Ñ)KÓLÑr*   rh   c                  ó(   — e Zd ZdZdxZZ ee«      Zy)Ú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.   r/   r0   r2   r   Ú_construct_elementsr4   r*   r'   rw   rw   Û   s   „ ñð (Ð'€I�Ù& yÓ1Ñr*   rw   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y)Ú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]'

    )Úexprri   rj   rk   rl   rl   rn   N)r+   r,   r-   r.   r/   r0   r   rJ   r2   r   Ú_construct_exprrq   rr   rs   rt   r4   r*   r'   r{   r{   î   sV   „ ñð GÐF€I�Ø™ ›
Ð#€HÙ" 7Ó+€OÙ% gÓ.ÐÙ# GÓ,ÐÙ" 7Ó+€OÙ" 7Ó+�Or*   r{   c                  ó   — e Zd ZdZd„ Zd„ Zy)Ú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                ó   — t        |«      dk(  r.|\  }}t        j                  | t        |«      t        |«      «      S t        |«      dk(  st        |«      dk(  r|d   dv rt        j                  | «      S t	        d«      ‚)Né   r   rn   )ú:Nz5Expected 0 or 2 args (or one argument == None or ':'))Úlenr   Ú__new__r   Ú
ValueError)rT   rH   ÚlowÚhighs       r'   r„   zExtent.__new__  sl   € Üˆt‹9˜Š>Ø‰IˆC�Ü—=‘= ¤g¨c£l´G¸D³MÓBÐBÜ�‹Y˜!Š^¤ D£	¨Q¢°4¸±7¸kÑ3IÜ—=‘= Ó%Ð%äÐTÓUÐUr*   c                óx   — t        | j                  «      dk(  rydj                  d„ | j                  D «       «      S )Nr   r‚   c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr$   )rS   )Ú.0r>   s     r'   ú	<genexpr>z#Extent._sympystr.<locals>.<genexpr>%  s   è ø€ Ò6 Sœ˜CŸÑ6ùs   ‚)rƒ   rH   Újoin)ÚselfÚprinters     r'   Ú	_sympystrzExtent._sympystr"  s.   € Üˆt�y‰y‹>˜QÒØØ�x‰xÑ6¨D¯I©IÔ6Ó6Ð6r*   N)r+   r,   r-   r.   r„   r�   r4   r*   r'   r   r     s   „ ñò$Vó7r*   r   c                 óâ  — t        | «      dkD  rt        d«      ‚g }| D ]«  }t        |t        «      r|j	                  |«       Œ%t        |t
        «      r:|dk(  r|j	                  t        «       «       ŒT|j	                  t        |«      «       Œot        |«      r|j	                  t        |Ž «       Œ’|j	                  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…   rF   r   ÚappendrS   r	   r   r   r   )rH   r[   r>   s      r'   r’   r’   *  sË   € ô ˆ4ƒy�1‚}ÜÐKÓLÐLØ€JØò ,ˆÜ�cœ6Ô"Ø×Ñ˜cÕ"Ü˜œSÔ!Ø�cŠzØ×!Ñ!¤&£(Õ+à×!Ñ!¤&¨£+Õ.Ü�cŒ]Ø×Ñœf c˜lÕ+à×Ñœg c›lÕ+ð,ô ˆ4ƒy�A‚~ÜÐ6Ó7Ð7Ü�[ *Ó-Ð-r*   Ú*Nr4   )ÚattrsÚvalueÚtypec               óv  — t        |t        «      r/t        |j                  «      dk7  rt	        dt        |«      z  «      ‚t        |Ž }t        |«      |gz   }|�9|t        t        t        fvrt        t        t        dœ|   }|j                  |«       |€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: %s)ÚinÚoutÚinout)r–   r•   )rF   r   rS   r!   r…   r’   Úlistr   r   r   r“   r   r^   )ÚsymbolÚdimÚintentr•   r–   r—   s         r'   Úarrayr    O  s­   € ô: �#”yÔ!Üˆs�x‰x‹=˜KÒ'ÜÐNÔQTÐUXÓQYÑYÓZÐZä˜ˆoˆä�‹K˜3˜%Ñ€EØÐØœ)¤Z´Ð>Ñ>Ü%¬jÄ<ÑPÐQWÑXˆFØ�‰�VÔØ€|Ü×Ñ ¨e¸5ÔAÐAä˜ ¨E¸Ô?Ð?r*   c                óN   — t        | t        «      rt        | «      S t        | «      S r$   )rF   rS   r	   r   r=   s    r'   Ú
_printabler¢   |  s   € Ü$ S¬#Ô.Œ6�#‹;Ð@´G¸C³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Ð%8Ó9Ð9r*   c                ó~   — t        dt        | «      g|rt        |«      gng z   |rt        |«      gz   «      S 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§   �  sX   € ô( ØÜ	�EÓ	ÐÙ!Œ*�S‹/Ñ	 rñ	+á#Œ*�TÓ
Ð	ñ	-óð ð *,ñ	-óð r*   c                ó~   — t        dt        | «      g|rt        |«      gng z   |rt        |«      gz   «      S g z   «      S )NÚuboundr¥   r¨   s      r'   r«   r«   ¬  sV   € ÜØÜ	�EÓ	ÐÙ!Œ*�S‹/Ñ	 rñ	+á#Œ*�TÓ
Ð	ñ	-óð ð *,ñ	-óð r*   c                ó\   — t        dt        | «      g|rt        |«      gz   «      S 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­   µ  sE   € ô& ØÜ	�FÓ	ÐÙ#Œ*�TÓ
Ð	ñ	-óð ð *,ñ	-óð r*   c                ó~   — t        dt        | «      g|rt        |«      gng z   |rt        |«      gz   «      S 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°   Ï  sX   € ô( ØÜ	�EÓ	ÐÙ!Œ*�S‹/Ñ	 rñ	+á#Œ*�TÓ
Ð	ñ	-óð ð *,ñ	-óð r*   c                ó’   — t        dt        | «      t        |«      g|rt        |«      gng z   |rt        |«      gz   «      S 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²   ë  s_   € ô ØÜ	�FÓ	œZ¨Ó.Ð/Ù!Œ*�S‹/Ñ	 rñ	+á #Œ*�UÓ
Ð	ñ	-óð ð *,ñ	-óð r*   c                ó>   — t        d| rt        | «      g«      S 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                  ó@   — e Zd ZdZdxZZdeiZ ee	«      Z
 ee«      Zy)Ú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.   r/   r0   r   rJ   r2   r   Ú_construct_labelsr   r}   r4   r*   r'   r¸   r¸     s1   „ ñð -Ð,€I�Ø˜ˆ~€HÙ$ YÓ/ÐÙ" 7Ó+�Or*   r¸   c                  ó0   — e Zd ZdZdxZZdeiZ ee	«      Z
y)Ú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.   r/   r0   r   rJ   r2   r   Ú_construct_return_valuer4   r*   r'   r¼   r¼   -  s(   „ ñð( ,Ð+€I�Ø Ð%€HÙ*¨7Ó3Ñr*   r¼   c                  ó   — e Zd ZdZd„ Zy)Ú	FFunctionéM   c           	     ó  — | j                   j                  }|j                  d   | j                  k  rt	        d|| j                  fz  «      ‚dj                  |dj                  t        |j                  | j                  «      «      «      S )NÚstandardz%s requires Fortran %d or newerz{}({})z, )
Ú	__class__r+   Ú	_settingsÚ_required_standardÚNotImplementedErrorÚformatrŒ   r]   Ú_printrH   )r�   rŽ   r!   s      r'   Ú_fcodezFFunction._fcodeJ  sy   € Ø�~‰~×&Ñ&ˆØ×Ñ˜ZÑ(¨4×+BÑ+BÒBÜ%Ð&GØ'+¨T×-DÑ-DÐ&Eñ'Fó Gð Gà�‰˜t T§Y¡Y¬s°7·>±>À4Ç9Á9Ó/MÓ%NÓOÐOr*   N)r+   r,   r-   rÆ   rÊ   r4   r*   r'   rÀ   rÀ   G  s   „ ØÐóPr*   rÀ   c                  ó   — e Zd ZdZy)ÚF95Functioné_   N)r+   r,   r-   rÆ   r4   r*   r'   rÌ   rÌ   R  s   „ ØÑr*   rÌ   c                  ó   — e Zd ZdZdZy)Úisignz/ Fortran sign intrinsic for integer arguments. r�   N©r+   r,   r-   r.   Únargsr4   r*   r'   rÏ   rÏ   V  s
   „ Ù9Ø�Er*   rÏ   c                  ó   — e Zd ZdZdZy)Údsignz8 Fortran sign intrinsic for double precision arguments. r�   NrÐ   r4   r*   r'   rÓ   rÓ   [  s
   „ ÙBØ�Er*   rÓ   c                  ó   — e Zd ZdZdZy)Úcmplxz& Fortran complex conversion function. r�   NrÐ   r4   r*   r'   rÕ   rÕ   `  s
   „ Ù0Ø�Er*   rÕ   c                  ó   — e Zd ZdZdZy)r©   z Fortran kind function. rn   NrÐ   r4   r*   r'   r©   r©   e  ó
   „ Ù"Ø�Er*   r©   c                  ó   — e Zd ZdZdZy)Úmergez Fortran merge function é   NrÐ   r4   r*   r'   rÙ   rÙ   j  r×   r*   rÙ   c                  ó(   — e Zd ZU ded<   ded<   d„ Zy)Ú_literalrS   Ú_tokenÚintÚ	_decimalsc                ó   — dj                  | j                  «      | z  j                  d«      \  }}|j                  d«      j	                  d«      }|d   |dd  j                  d«      }}|dk(  rdn|}|xs d| j                  z   |z   |xs dz   S )	Nz%.{}eÚeÚ0ú.r   rn   ú+Ú )rÈ   rß   ÚsplitÚstripÚrstripÚlstriprÝ   )r�   rŽ   rH   ÚkwargsÚmantissaÚsgnd_exÚex_sgnÚex_nums           r'   rÊ   z_literal._fcodes  sŽ   € Ø$Ÿ^™^¨D¯N©NÓ;¸dÑB×IÑIÈ#ÓNÑˆ�'Ø—>‘> #Ó&×-Ñ-¨cÓ2ˆØ  ™ W¨Q¨R [×%7Ñ%7¸Ó%<�ˆØ ’}‘¨&ˆØ’˜C 4§;¡;Ñ.°Ñ7¸6º=ÀSÑIÐIr*   N)r+   r,   r-   Ú__annotations__rÊ   r4   r*   r'   rÜ   rÜ   o  s   … ØƒKØƒNóJr*   rÜ   c                  ó   — e Zd ZdZdZdZy)Ú
literal_spz' Fortran single precision real literal rá   é	   N©r+   r,   r-   r.   rÝ   rß   r4   r*   r'   rñ   rñ   {  s   „ Ù1Ø€FØ�Ir*   rñ   c                  ó   — e Zd ZdZdZdZy)Ú
literal_dpz' Fortran double precision real literal Údé   Nró   r4   r*   r'   rõ   rõ   �  s   „ Ù1Ø€FØ�Ir*   rõ   c                  ó>   — e Zd ZdxZZeedœZ ee«      Z	 ee«      Z
y)Úsum_©r    rž   Úmask©rž   rû   N©r+   r,   r-   r/   r0   r   rJ   r2   r   Ú_construct_arrayÚ_construct_dimr4   r*   r'   rù   rù   ‡  ó+   „ Ø2Ð2€I�Ø TÑ*€HÙ# GÓ,ÐÙ! 'Ó*�Nr*   rù   c                  ó>   — e Zd ZdxZZeedœZ ee«      Z	 ee«      Z
y)Úproduct_rú   rü   Nrý   r4   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    r6   r?   rA   rO   rZ   rd   rh   rw   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  r4   r*   r'   ú<module>r     s  ðñõ #÷÷ õ õ #Ý 'Ý  Ý (ß -Ý !Ý &ß #Ý .ñ �Ó€Ù�kÓ"€	á�kÓ"€	Ù�|Ó$€
Ù˜Ó(€á˜Ó&€ôBˆeô Bô*!�ô !ò(ô~ˆ%ô ~ô.GˆUô Gô<#�ô #ô>9�Uô 9ô""Mˆô "MôJ2�uô 2ô&,�Eô ,ô07ˆUô 7ñB “€ò .ñF ˜‹~€ð+@¨R°tÀ$ô +@òZAò:ó ó8óó4ó8ó$?ô:,ˆ5ô ,ô&4�Eô 4ô4P�ô Pô�)ô ôˆIô ô
ˆIô ô
ˆIô ô
ˆ9ô ô
ˆKô ô
	Jˆuô 	Jô�ô ô�ô ô+ˆ5�$ô +ô+ˆu�dõ +r*   