~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/m2sci/help/en_US/About_M2SCI_tools.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
    *
12
12
    -->
13
13
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="About_M2SCI_tools">
14
 
  <refnamediv>
15
 
    <refname>About M2SCI tools</refname>
16
 
    <refpurpose>Generally speaking about tools to convert Matlab files to Scilab</refpurpose>
17
 
  </refnamediv>
18
 
  <refsection>
19
 
    <title>Description</title>
20
 
    <para>Scilab includes useful tools to convert Matlab M-files to Scilab.</para>
21
 
    <para>
22
 
      Taking a Matlab M-file, <literal>mfile2sci</literal> modifies this files so that it can be
23
 
      compiled by Scilab. After that this compiled code is converted to a "tree" of instructions
24
 
      by <literal>macr2tree</literal>. This "tree" is an imbrication of Scilab lists and tlists and
25
 
      is the basis for conversion. Each instruction of this "tree" is converted to Scilab and
26
 
      inference is done to known what are the variables. Once this "tree" is converted to Scilab,
27
 
      code is generated using <literal>tree2code</literal>.
28
 
    </para>
29
 
    <para>
30
 
      All tlists used for coding this tree (and we call "MSCI tlists") are listed below:
31
 
    </para>
32
 
    <itemizedlist>
33
 
      <listitem>
34
 
        <variablelist>
35
 
          <varlistentry>
36
 
            <term>funcall</term>
37
 
            <listitem>
38
 
              <para>
39
 
                tlist representing a function call created by <literal>Funcall</literal>
40
 
              </para>
41
 
            </listitem>
42
 
          </varlistentry>
43
 
          <varlistentry>
44
 
            <term>operation</term>
45
 
            <listitem>
46
 
              <para>
47
 
                tlist representing an operation created by <literal>Operation</literal>
48
 
              </para>
49
 
            </listitem>
50
 
          </varlistentry>
51
 
          <varlistentry>
52
 
            <term>variable</term>
53
 
            <listitem>
54
 
              <para>
55
 
                tlist representing a variable created by <literal>Variable</literal>
56
 
              </para>
57
 
            </listitem>
58
 
          </varlistentry>
59
 
          <varlistentry>
60
 
            <term>cste</term>
61
 
            <listitem>
62
 
              <para>
63
 
                tlist representing a constant created by <literal>Cste</literal>
64
 
              </para>
65
 
            </listitem>
66
 
          </varlistentry>
67
 
          <varlistentry>
68
 
            <term>equal</term>
69
 
            <listitem>
70
 
              <para>
71
 
                tlist representing an instruction created by <literal>Equal</literal>
72
 
              </para>
73
 
            </listitem>
74
 
          </varlistentry>
75
 
          <varlistentry>
76
 
            <term>ifthenelse</term>
77
 
            <listitem>
78
 
              <para>tlist representing an IF/THEN/ELSE control instruction created inside M2SCI kernel functions</para>
79
 
            </listitem>
80
 
          </varlistentry>
81
 
          <varlistentry>
82
 
            <term>while</term>
83
 
            <listitem>
84
 
              <para>tlist representing a WHILE control instruction created inside M2SCI kernel functions</para>
85
 
            </listitem>
86
 
          </varlistentry>
87
 
          <varlistentry>
88
 
            <term>selectcase</term>
89
 
            <listitem>
90
 
              <para>tlist representing a SELECT/CASE control instruction created inside M2SCI kernel functions</para>
91
 
            </listitem>
92
 
          </varlistentry>
93
 
          <varlistentry>
94
 
            <term>for</term>
95
 
            <listitem>
96
 
              <para>tlist representing a FOR control instruction created inside M2SCI kernel functions</para>
97
 
            </listitem>
98
 
          </varlistentry>
99
 
        </variablelist>
100
 
      </listitem>
101
 
    </itemizedlist>
102
 
    <para>
103
 
      The contents of these tlists is described in corresponding help pages.
104
 
    </para>
105
 
    <para>
106
 
      Operations are converted using a fonction named <literal>%&lt;opcode&gt;2sci</literal> with opcode
107
 
      the Scilab code for this operator. See help page for overloading to have these codes. All
108
 
      these functions are already written and are in directory SCI/modules/m2sci/macros/percent/.
109
 
    </para>
110
 
    <para>
111
 
      Function calls are converted using a function called <literal>sci_&lt;Matlab_function_name&gt;</literal>.
112
 
      Some of these functions have been written and are in directory SCI/modules/m2sci/macros/sci_files/.
113
 
      We are working on increasing the set of Matlab functions converted. However, everybody can
114
 
      written such functions using help page sci_files.
115
 
    </para>
116
 
    <para>
117
 
      Inference is done using tlists of type "infer" containing fields:
118
 
    </para>
119
 
    <itemizedlist>
120
 
      <listitem>
121
 
        <variablelist>
122
 
          <varlistentry>
123
 
            <term>dims</term>
124
 
            <listitem>
125
 
              <para>list of dimensions</para>
126
 
            </listitem>
127
 
          </varlistentry>
128
 
          <varlistentry>
129
 
            <term>type</term>
130
 
            <listitem>
131
 
              <para>"type" tlist</para>
132
 
            </listitem>
133
 
          </varlistentry>
134
 
          <varlistentry>
135
 
            <term>contents</term>
136
 
            <listitem>
137
 
              <para>"contents" tlist if a Cell or a Struct</para>
138
 
            </listitem>
139
 
          </varlistentry>
140
 
        </variablelist>
141
 
      </listitem>
142
 
    </itemizedlist>
143
 
    <para>
144
 
      Type is a tlist of type "type" containing fields:
145
 
    </para>
146
 
    <itemizedlist>
147
 
      <listitem>
148
 
        <variablelist>
149
 
          <varlistentry>
150
 
            <term>vtype</term>
151
 
            <listitem>
152
 
              <para>data type</para>
153
 
            </listitem>
154
 
          </varlistentry>
155
 
          <varlistentry>
156
 
            <term>property</term>
157
 
            <listitem>
158
 
              <para>property</para>
159
 
            </listitem>
160
 
          </varlistentry>
161
 
        </variablelist>
162
 
      </listitem>
163
 
    </itemizedlist>
164
 
    <para>To have more details about inference see help page for m2scideclare.</para>
165
 
  </refsection>
166
 
  <refsection role="see also">
167
 
    <title>See Also</title>
168
 
    <simplelist type="inline">
169
 
      <member>
170
 
        <link linkend="mfile2sci">mfile2sci</link>
171
 
      </member>
172
 
      <member>
173
 
        <link linkend="translatepaths">translatepaths</link>
174
 
      </member>
175
 
      <member>
176
 
        <link linkend="overloading">overloading</link>
177
 
      </member>
178
 
      <member>
179
 
        <link linkend="sci_files">sci_files</link>
180
 
      </member>
181
 
      <member>
182
 
        <link linkend="Funcall">Funcall</link>
183
 
      </member>
184
 
      <member>
185
 
        <link linkend="Operation">Operation</link>
186
 
      </member>
187
 
      <member>
188
 
        <link linkend="Variable">Variable</link>
189
 
      </member>
190
 
      <member>
191
 
        <link linkend="Cste">Cste</link>
192
 
      </member>
193
 
      <member>
194
 
        <link linkend="Infer">Infer</link>
195
 
      </member>
196
 
      <member>
197
 
        <link linkend="Type">Type</link>
198
 
      </member>
199
 
      <member>
200
 
        <link linkend="Equal">Equal</link>
201
 
      </member>
202
 
      <member>
203
 
        <link linkend="m2scideclare">m2scideclare</link>
204
 
      </member>
205
 
    </simplelist>
206
 
  </refsection>
 
14
    <refnamediv>
 
15
        <refname>About M2SCI tools</refname>
 
16
        <refpurpose>Generally speaking about tools to convert Matlab files to Scilab</refpurpose>
 
17
    </refnamediv>
 
18
    <refsection>
 
19
        <title>Description</title>
 
20
        <para>Scilab includes useful tools to convert Matlab M-files to Scilab.</para>
 
21
        <para>
 
22
            Taking a Matlab M-file, <literal>mfile2sci</literal> modifies this files so that it can be
 
23
            compiled by Scilab. After that this compiled code is converted to a "tree" of instructions
 
24
            by <literal>macr2tree</literal>. This "tree" is an imbrication of Scilab lists and tlists and
 
25
            is the basis for conversion. Each instruction of this "tree" is converted to Scilab and
 
26
            inference is done to known what are the variables. Once this "tree" is converted to Scilab,
 
27
            code is generated using <literal>tree2code</literal>.
 
28
        </para>
 
29
        <para>
 
30
            All tlists used for coding this tree (and we call "MSCI tlists") are listed below:
 
31
        </para>
 
32
        <itemizedlist>
 
33
            <listitem>
 
34
                <variablelist>
 
35
                    <varlistentry>
 
36
                        <term>funcall</term>
 
37
                        <listitem>
 
38
                            <para>
 
39
                                tlist representing a function call created by <literal>Funcall</literal>
 
40
                            </para>
 
41
                        </listitem>
 
42
                    </varlistentry>
 
43
                    <varlistentry>
 
44
                        <term>operation</term>
 
45
                        <listitem>
 
46
                            <para>
 
47
                                tlist representing an operation created by <literal>Operation</literal>
 
48
                            </para>
 
49
                        </listitem>
 
50
                    </varlistentry>
 
51
                    <varlistentry>
 
52
                        <term>variable</term>
 
53
                        <listitem>
 
54
                            <para>
 
55
                                tlist representing a variable created by <literal>Variable</literal>
 
56
                            </para>
 
57
                        </listitem>
 
58
                    </varlistentry>
 
59
                    <varlistentry>
 
60
                        <term>cste</term>
 
61
                        <listitem>
 
62
                            <para>
 
63
                                tlist representing a constant created by <literal>Cste</literal>
 
64
                            </para>
 
65
                        </listitem>
 
66
                    </varlistentry>
 
67
                    <varlistentry>
 
68
                        <term>equal</term>
 
69
                        <listitem>
 
70
                            <para>
 
71
                                tlist representing an instruction created by <literal>Equal</literal>
 
72
                            </para>
 
73
                        </listitem>
 
74
                    </varlistentry>
 
75
                    <varlistentry>
 
76
                        <term>ifthenelse</term>
 
77
                        <listitem>
 
78
                            <para>tlist representing an IF/THEN/ELSE control instruction created inside M2SCI kernel functions</para>
 
79
                        </listitem>
 
80
                    </varlistentry>
 
81
                    <varlistentry>
 
82
                        <term>while</term>
 
83
                        <listitem>
 
84
                            <para>tlist representing a WHILE control instruction created inside M2SCI kernel functions</para>
 
85
                        </listitem>
 
86
                    </varlistentry>
 
87
                    <varlistentry>
 
88
                        <term>selectcase</term>
 
89
                        <listitem>
 
90
                            <para>tlist representing a SELECT/CASE control instruction created inside M2SCI kernel functions</para>
 
91
                        </listitem>
 
92
                    </varlistentry>
 
93
                    <varlistentry>
 
94
                        <term>for</term>
 
95
                        <listitem>
 
96
                            <para>tlist representing a FOR control instruction created inside M2SCI kernel functions</para>
 
97
                        </listitem>
 
98
                    </varlistentry>
 
99
                </variablelist>
 
100
            </listitem>
 
101
        </itemizedlist>
 
102
        <para>
 
103
            The contents of these tlists is described in corresponding help pages.
 
104
        </para>
 
105
        <para>
 
106
            Operations are converted using a fonction named <literal>%&lt;opcode&gt;2sci</literal> with opcode
 
107
            the Scilab code for this operator. See help page for overloading to have these codes. All
 
108
            these functions are already written and are in directory SCI/modules/m2sci/macros/percent/.
 
109
        </para>
 
110
        <para>
 
111
            Function calls are converted using a function called <literal>sci_&lt;Matlab_function_name&gt;</literal>.
 
112
            Some of these functions have been written and are in directory SCI/modules/m2sci/macros/sci_files/.
 
113
            We are working on increasing the set of Matlab functions converted. However, everybody can
 
114
            written such functions using help page sci_files.
 
115
        </para>
 
116
        <para>
 
117
            Inference is done using tlists of type "infer" containing fields:
 
118
        </para>
 
119
        <itemizedlist>
 
120
            <listitem>
 
121
                <variablelist>
 
122
                    <varlistentry>
 
123
                        <term>dims</term>
 
124
                        <listitem>
 
125
                            <para>list of dimensions</para>
 
126
                        </listitem>
 
127
                    </varlistentry>
 
128
                    <varlistentry>
 
129
                        <term>type</term>
 
130
                        <listitem>
 
131
                            <para>"type" tlist</para>
 
132
                        </listitem>
 
133
                    </varlistentry>
 
134
                    <varlistentry>
 
135
                        <term>contents</term>
 
136
                        <listitem>
 
137
                            <para>"contents" tlist if a Cell or a Struct</para>
 
138
                        </listitem>
 
139
                    </varlistentry>
 
140
                </variablelist>
 
141
            </listitem>
 
142
        </itemizedlist>
 
143
        <para>
 
144
            Type is a tlist of type "type" containing fields:
 
145
        </para>
 
146
        <itemizedlist>
 
147
            <listitem>
 
148
                <variablelist>
 
149
                    <varlistentry>
 
150
                        <term>vtype</term>
 
151
                        <listitem>
 
152
                            <para>data type</para>
 
153
                        </listitem>
 
154
                    </varlistentry>
 
155
                    <varlistentry>
 
156
                        <term>property</term>
 
157
                        <listitem>
 
158
                            <para>property</para>
 
159
                        </listitem>
 
160
                    </varlistentry>
 
161
                </variablelist>
 
162
            </listitem>
 
163
        </itemizedlist>
 
164
        <para>To have more details about inference see help page for m2scideclare.</para>
 
165
    </refsection>
 
166
    <refsection role="see also">
 
167
        <title>See Also</title>
 
168
        <simplelist type="inline">
 
169
            <member>
 
170
                <link linkend="mfile2sci">mfile2sci</link>
 
171
            </member>
 
172
            <member>
 
173
                <link linkend="translatepaths">translatepaths</link>
 
174
            </member>
 
175
            <member>
 
176
                <link linkend="overloading">overloading</link>
 
177
            </member>
 
178
            <member>
 
179
                <link linkend="sci_files">sci_files</link>
 
180
            </member>
 
181
            <member>
 
182
                <link linkend="Funcall">Funcall</link>
 
183
            </member>
 
184
            <member>
 
185
                <link linkend="Operation">Operation</link>
 
186
            </member>
 
187
            <member>
 
188
                <link linkend="Variable">Variable</link>
 
189
            </member>
 
190
            <member>
 
191
                <link linkend="Cste">Cste</link>
 
192
            </member>
 
193
            <member>
 
194
                <link linkend="Infer">Infer</link>
 
195
            </member>
 
196
            <member>
 
197
                <link linkend="Type">Type</link>
 
198
            </member>
 
199
            <member>
 
200
                <link linkend="Equal">Equal</link>
 
201
            </member>
 
202
            <member>
 
203
                <link linkend="m2scideclare">m2scideclare</link>
 
204
            </member>
 
205
        </simplelist>
 
206
    </refsection>
207
207
</refentry>