Revision of help pages of module "data_structures" (en_US, ru_RU).
[scilab.git] / scilab / modules / data_structures / help / en_US / typeof.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - INRIA
5  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11  *
12  -->
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:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="typeof" xml:lang="en">
14     <refnamediv>
15         <refname>typeof</refname>
16         <refpurpose>object type</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>[t]=typeof(object)</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>object</term>
27                 <listitem>
28                     <para>a Scilab object</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>t</term>
33                 <listitem>
34                     <para>a string</para>
35                 </listitem>
36             </varlistentry>
37         </variablelist>
38     </refsection>
39     <refsection>
40         <title>Description</title>
41         <para>
42             <literal>t=typeof(object)</code> returns one of the following
43             strings:
44         </para>
45         <variablelist>
46             <varlistentry>
47                 <term>"constant"</term>
48                 <listitem>
49                     <para>if <varname>object</varname> is a real or complex matrix of double.</para>
50                 </listitem>
51             </varlistentry>
52             <varlistentry>
53                 <term>"polynomial"</term>
54                 <listitem>
55                     <para>
56                         if <varname>object</varname> is a <link linkend="poly">polynomial matrix</link>.
57                     </para>
58                 </listitem>
59             </varlistentry>
60             <varlistentry>
61                 <term>"function"</term>
62                 <listitem>
63                     <para>
64                         if <varname>object</varname> is a <link linkend="function">function</link> (Scilab code). See also <link linkend="deff">deff</link>.
65                     </para>
66                 </listitem>
67             </varlistentry>
68             <varlistentry>
69                 <term>"handle"</term>
70                 <listitem>
71                     <para>
72                         if <varname>object</varname> is an <link linkend="graphics_entities">handle</link>.
73                     </para>
74                 </listitem>
75             </varlistentry>
76             <varlistentry>
77                 <term>"string"</term>
78                 <listitem>
79                     <para>
80                         if <varname>object</varname> is a matrix made of <link linkend="strings">character strings</link>.
81                     </para>
82                 </listitem>
83             </varlistentry>
84             <varlistentry>
85                 <term>"boolean"</term>
86                 <listitem>
87                     <para>
88                         if <varname>object</varname> is a <link linkend="matrices">boolean matrix</link>.
89                     </para>
90                 </listitem>
91             </varlistentry>
92             <varlistentry>
93                 <term>"list"</term>
94                 <listitem>
95                     <para>
96                         if <varname>object</varname> is a <link linkend="list">list</link>.
97                     </para>
98                 </listitem>
99             </varlistentry>
100             <varlistentry>
101                 <term>"rational"</term>
102                 <listitem>
103                     <para>
104                         if <varname>object</varname> is a <link linkend="rational">rational matrix</link> (transfer matrix).
105                     </para>
106                 </listitem>
107             </varlistentry>
108             <varlistentry>
109                 <term>"state-space"</term>
110                 <listitem>
111                     <para>
112                         if <varname>object</varname> is a state-space model (see <link linkend="syslin">syslin</link>).
113                     </para>
114                 </listitem>
115             </varlistentry>
116             <varlistentry>
117                 <term>"sparse"</term>
118                 <listitem>
119                     <para>
120                         if <varname>object</varname> is a (real) <link linkend="sparse">sparse matrix</link>.
121                     </para>
122                 </listitem>
123             </varlistentry>
124             <varlistentry>
125                 <term>"boolean sparse"</term>
126                 <listitem>
127                     <para>
128                         if <varname>object</varname> is a <link linkend="sparse">boolean sparse matrix</link>.
129                     </para>
130                 </listitem>
131             </varlistentry>
132             <varlistentry>
133                 <term>"hypermat"</term>
134                 <listitem>
135                     <para>
136                       if <varname>object</varname> is a <link linkend="hypermatrices">hypermatrix</link> (<litera>N</literal>-dimension array with <litera><![CDATA[N<=3]]></litera>.
137                     </para>
138                 </listitem>
139             </varlistentry>
140             <varlistentry>
141                 <term>"st"</term>
142                 <listitem>
143                     <para>
144                         if <varname>object</varname> is a <link linkend="struct">structure</link>.
145                     </para>
146                 </listitem>
147             </varlistentry>
148             <varlistentry>
149                 <term>"ce"</term>
150                 <listitem>
151                     <para>
152                         if <varname>object</varname> is a <link linkend="cell">cell</link> array.
153                     </para>
154                 </listitem>
155             </varlistentry>
156             <varlistentry>
157                 <term>"fptr"</term>
158                 <listitem>
159                     <para>if <varname>object</varname> is a built-in Scilab function, called also <emphasis role="italic">gateway</emphasis> (C, C++ or Fortran code).</para>
160                 </listitem>
161             </varlistentry>
162             <varlistentry>
163                 <term>"pointer"</term>
164                 <listitem>
165                     <para>
166                         if <varname>object</varname> is a pointer (See an use case: <link linkend="lufact">lufact</link>).
167                     </para>
168                 </listitem>
169             </varlistentry>
170             <varlistentry>
171                 <term>"size implicit"</term>
172                 <listitem>
173                     <para>if <varname>object</varname> is a size implicit polynomial used for indexing. This a purely internal value.</para>
174                 </listitem>
175             </varlistentry>
176             <varlistentry>
177                 <term>"library"</term>
178                 <listitem>
179                     <para>if <varname>object</varname> is a function <link linkend="library">library</link>.</para>
180                 </listitem>
181             </varlistentry>
182             <varlistentry>
183                 <term>"int8" or "uint8" or "int16" or "uint16" or "int32" or "uint32"</term>
184                 <listitem>
185                     <para>
186                         if <varname>object</varname> is a matrix of [unsigned] integers stored on 8, 16 or 32 bits. (See <link linkend="int8">int</link>)
187                     </para>
188                 </listitem>
189             </varlistentry>
190         </variablelist>
191         <para>
192           <note>
193             Note that if the <varname>object</varname> is a <link linkend="tlist">tlist</link> or <link linkend="mlist">mlist</link>, <function>typeof</function> will return the first string in the first list entry.
194           </note>
195         </para>
196     </refsection>
197     <refsection>
198         <title>Examples</title>
199         <programlisting role="example"><![CDATA[ 
200 typeof(1)
201 typeof(poly(0,'x'))
202  
203 typeof(1/poly(0,'x'))
204 typeof(%t)
205  
206 w=sprand(100,100,0.001);
207 typeof(w)
208 typeof(w==w)
209  
210 deff('y=f(x)','y=2*x');
211 typeof(f)
212  
213 L=tlist(['V','a','b'],18,'Scilab');
214 typeof(L)
215  
216 typeof(corelib)
217  ]]></programlisting>
218     </refsection>
219     <refsection role="see also">
220         <title>See Also</title>
221         <simplelist type="inline">
222             <member>
223                 <link linkend="type">type</link>
224             </member>
225             <member>
226                 <link linkend="strings">strings</link>
227             </member>
228             <member>
229                 <link linkend="syslin">syslin</link>
230             </member>
231             <member>
232                 <link linkend="poly">poly</link>
233             </member>
234         </simplelist>
235     </refsection>
236 </refentry>