Details of the CodeGeneration Package
|
Basic Information
|
|
•
|
This help page contains complete information about the CodeGeneration package. For basic information on the CodeGeneration package, see the CodeGeneration help page.
|
|
|
Description
|
|
•
|
The CodeGeneration package is a collection of commands and subpackages that enable the translation of Maple code to other languages. The exports of this package fall into two categories: translators to specific target languages and commands that allow the user to extend the translation facility.
|
•
|
Each command in the CodeGeneration package can be accessed by using either the long form or the short form of the command name in the command calling sequence. As the underlying implementation of the CodeGeneration package is a module, you can also use the form CodeGeneration:-command to access a command from the package. For more information, see the Module Members help page.
|
|
|
List of CodeGeneration Package Commands
|
|
|
The following is a list of available commands and subpackages.
|
|
|
Examples
|
|
>
|
|
| (1) |
Generate C code and declare variable types.
>
|
|
cg = x - 0.3e1 * (double) y * z;
| |
Generate MATLAB(R) code where the output is a string.
>
|
|
| (2) |
Generate Fortran code and specify single precision for floating-point variables and constants.
>
|
f:= proc(x) return x^2; end proc:
|
>
|
|
real function f (x)
real x
f = x ** 2
return
end
| |
Generate Visual Basic code
>
|
|
s = 0.10E1 + x
t = Log(s) * Exp(-x)
r = Exp(-x) + x * t
| |
|
|
Download Help Document
Was this information helpful?