summaryrefslogtreecommitdiffstats
path: root/scilab/modules/maple2scilab/readme.txt
blob: 7e36ae454f7fb6c0aeb8a92b71f05e5a5a33aba6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#****************************************************************************
#                          Maple to Scilab interface
#                        Version 1.1.2 (7 July 2004)
#                       Copyright (C) 1997-2004 INRIA 
#
#                                Claude Gomez				    
#			email: Claude.Gomez@inria.fr
#	       Web site: http://www-rocq.inria.fr/scilab/gomez
#									    
#				 SCILAB project				    
#									    
#                              INRIA-Rocquencourt
# 			      Domaine de Voluceau			    
# 			             BP 105			    
# 			     78153 Le Chesnay Cedex			    
# 				     FRANCE				    
#****************************************************************************
This directory contains the Maple to Scilab interface. 
It allows to translate Maple matrices into Scilab functions, via C,
via Fortran or directly into Scilab code.
-----------------------------------------------------------------------------
IMPORTANT FILES IN THIS DIRECTORY:

"macroC.mpl" is the macroC Maple package to generate C code
"macrofort.mpl" is the macrofort Maple package to generate Fortran code
"maple2scilab.mpl" is the maple2scilab Maple package

"examples.mpl" gives Maple examples of the use of maple2scilab Maple package
"examples.tst" shows how to load into Scilab the files generated by
               "examples.tst"
------------------------------------------------------------------------------
HOW TO USE THE MAPLE TO SCILAB INTERFACE?

First you need Maple 6 or above.

maple2scilab(fname,expr,parameters,code,[directory])

The "maple2scilab" Maple procedure translates a Maple matrix "expr"
into a Scilab function "fname". "expr" can also be an algebraic
expression, a vector, a bi-dimensional array or a list of lists. If
"expr" is a sparse Maple matrix, a sparse Scilab matrix is returned by
Scilab function "fname".
NOTE that "maple2scilab" works only with vectors and matrices of
"linalg" package.

If the Maple matrix have parameters, you have to put then in "parameters" as a
list. They are changed into arguments of the Scilab function. If there is no
parameter, put an empty list.

Then you have to load the generated code into Scilab: the way to do that is
printed by the "maple2scilab" procedure.

The translation is made via: Fortran if "code" is 'f'
                             C if "code" is 'c'
                             directly into Scilab if code is 's'.

If a fifth argument is present, it is the directory where the source codes of
the Scilab function, Fortran subroutine or C function are generated.
Otherwise, the current directory is used.

When generating C code, the generated file must include the "machine.h" header
distributed with Scilab in the "routines" directory. Its path must be given in
the Maple global variable "machine_include". For instance, do in Maple:
machine_include:="/usr/bin/scilab/routines/machine.h";

By default, the Fortran or C generated code is not optimized. If you want to
generate optimized code do:
optimized:=true;

For generating C code, you need to load "macroC.mpl" before 
"maple2scilab.mpl".
For generating Fortran code, you need to load "macrofort.mpl" 
before "maple2scilab.mpl".

See the file "examples.mpl" to see a few examples.
------------------------------------------------------------------------------
MAKING TESTS:

If you load "examples.mpl" into Maple, the Maple output is in the 
file "examples.out" and the Scilab output is in the file "examples.tst".
The output of the execution of "examples.tst" must be the the same as 
"examples.dia.ref".

If necessary, change the path of Scilab and the way to call Fortran and C 
compilers at the beginning of "examples.mpl".

On Unix systems, you can execute "make tests" to automatically make the
tests. Note that it is possible you need to change the path of Maple program
and Scilab program at the beginning of the "Makefile".
------------------------------------------------------------------------------