#****************************************************************************
# 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".
------------------------------------------------------------------------------