![]() P := proc(x,y) if y>0 then trunc(x) else ceil(x) end if end proc: Translate a module with one exported and one local procedure. Translate a procedure accepting an Array as a parameter. A new variable is created to hold the return value. Translate a procedure containing an implicit return. į := proc(x, y, z) return x*y-y*z+x*z end proc:įortran f, defaulttype = integer Assume that all untyped variables have type integer. S ≔ Fortran x + y + 1, declare = x :: float, y :: ' integer ', output = string Optimize the input first.Ĭs ≔ s = 1.0 + x, t = ln s exp − x, r = exp − x + x t :ĭeclare that x is a float and y is an integer. Translate a list and assign to an array with name "w" in the target code.įortran x, 2 y, 5, z, resultname = w Translate a simple expression and assign to the name "w" in the target code.įortran x + y z − 2 x z, resultname = w ![]() See CodeGenerationOptions for a description of the options used in the following examples. For more information about translation to Fortran in particular, see FortranDetails. By default, such names are automatically replaced because they do not comply with the Fortran 77 standard.įor more information about how the CodeGeneration package translates Maple code to other languages, see Translation Details. The limitvariablelength=false option, available for this command only, allows you to use names longer than 6 characters. The parameter cgopts may include one or more CodeGeneration options, as described in CodeGenerationOptions. If x is a module, then a Fortran program is generated, as described on the FortranDetails help page. ![]() If x is a procedure, then either a Fortran function or a subroutine is generated. In this case, the equivalent sequence of Fortran assignment statements is generated. If x is a list of equations nm = expr where nm is a name and expr is an algebraic expression, this is understood to mean a sequence of assignment statements. Only the initialized elements of the rtable or Maple Array are translated. If x is a list, rtable or Maple Array of algebraic expressions, then a sequence of Fortran statements assigning the elements to a Fortran array is produced. If the parameter x is an algebraic expression, then a Fortran statement assigning the expression to a variable is generated. The Fortran command translates Maple code to Fortran 77 code. (optional) one or more CodeGeneration options Expression, list, rtable, procedure, or module ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |