|
Overview of the CodeGeneration Package
|
|
Basic Functionality
|
|
|
|
Description
|
|
|
•
|
The CodeGeneration package is a collection of commands and subpackages that enable the translation of Maple code to other programming languages.
|
|
|
|
Output
|
|
|
•
|
Translated source code in the target language.
|
|
|
|
|
Accessing CodeGeneration Package Commands
|
|
|
•
|
Each command in the CodeGeneration package can be accessed by using the long form or the short form of the command in the command calling sequence.
|
|
>
|
CodeGeneration[C]([[x, 2*y], [5, z]]);
|
|
|
|
Essential CodeGeneration Package Commands
|
|
|
C
|
translate Maple code to C code
|
|
CSharp
|
translate Maple code to CSharp code
|
|
Fortran
|
translate Maple code to Fortran code
|
|
Java
|
translate Maple code to Java code
|
|
Matlab
|
translate Maple code to MATLAB code
|
|
VisualBasic
|
translate Maple code to VisualBasic code
|
|
|
|
|
|
Examples
|
|
|
>
|
|
|
| (1) |
Generate C code
|
>
|
|
|
cg = -2 * x * z + x + y + z;
| |
Generate MATLAB(R) code
|
>
|
|
|
cg0 = [x 2 * y + z; x * y z;];
| |
Generate Visual Basic code
|
>
|
|
|
s = 0.10E1 + x
t = Log(s) * Exp(-x)
r = Exp(-x) + x * t
| |
|
|
|
Details
|
|
|
|
For more information including:
|
|
•
|
options available to alter the translated output
|
|
•
|
extending the CodeGeneration package using the LanguageDefinition subpackage
|
|
|
Download Help Document
Was this information helpful?