typeof was refering to xmlobjects instead of XMLObjects
[scilab.git] / scilab / modules / data_structures / help / pt_BR / 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  * Copyright (C) 2015 - 2016 - Samuel GOUGEON
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="pt">
17     <refnamediv>
18         <refname>typeof</refname>
19         <refpurpose>tipo do objeto</refpurpose>
20     </refnamediv>
21     <refsynopsisdiv>
22         <title>Seqüência de Chamamento</title>
23         <synopsis>
24             t = typeof(object)
25             oc = typeof(object, "overload")
26         </synopsis>
27     </refsynopsisdiv>
28     <refsection role="arguments">
29         <title>Parâmetros</title>
30         <variablelist>
31             <varlistentry>
32                 <term>object</term>
33                 <listitem>
34                     <para>objeto Scilab</para>
35                 </listitem>
36             </varlistentry>
37             <varlistentry>
38                 <term>t</term>
39                 <listitem>
40                     <para>
41                         a string (may have spaces): the name of the type of <varname>object</varname>
42                     </para>
43                 </listitem>
44             </varlistentry>
45             <varlistentry>
46                 <term>oc</term>
47                 <listitem>
48                     <para>a string (without spaces): the name of the overloading code for the
49                         <varname>object</varname>.
50                     </para>
51                 </listitem>
52             </varlistentry>
53         </variablelist>
54     </refsection>
55     <refsection role="description">
56         <title>Descrição</title>
57         <para>
58             <literal>t = typeof(object)</literal> retorna um dos seguintes
59             strings:
60         </para>
61         <table>
62             <tr>
63                 <td>
64                     <emphasis role="bold">string</emphasis>
65                 </td>
66                 <td>
67                     <varname>object</varname> é uma matriz ou hipermatriz de
68                     <link linkend="strings">caracteres</link> e/o textos.
69                 </td>
70             </tr>
71             <tr>
72                 <td>
73                     <emphasis role="bold">boolean</emphasis>
74                 </td>
75                 <td>
76                     <varname>object</varname> é uma matriz ou hipermatriz de valores
77                     booleanos.
78                 </td>
79             </tr>
80             <tr><td colspan="2">
81                     <emphasis role="bold">int8</emphasis> ou
82                     <emphasis role="bold">int16</emphasis> ou
83                     <emphasis role="bold">int32</emphasis> ou
84                     <emphasis role="bold">int64</emphasis> ou
85                     <emphasis role="bold">uint8</emphasis> ou
86                     <emphasis role="bold">uint16</emphasis> ou
87                     <emphasis role="bold">uint32</emphasis> ou
88                     <emphasis role="bold">uint64</emphasis>
89                 </td>
90             </tr>
91             <tr>
92                 <td> </td>
93                 <td>
94                     <varname>object</varname> is a matrix or hypermatrix of [unsigned]
95                     integers stored
96                     on 8, 16, 32 or 64 bits. (see <link linkend="inttype">inttype</link>)
97                 </td>
98             </tr>
99             <tr>
100                 <td>
101                     <emphasis role="bold">constant</emphasis>
102                 </td>
103                 <td>
104                     <varname>object</varname> é uma matriz ou hipermatriz
105                     de números reais ou complexos
106                 </td>
107             </tr>
108             <tr>
109                 <td>
110                     <emphasis role="bold">polynomial</emphasis>
111                 </td>
112                 <td>
113                     <varname>object</varname> é uma matriz ou hipermatriz de
114                     <link linkend="poly">polinômios</link>
115                     com coeficientes reais ou complexos.
116                 </td>
117             </tr>
118             <tr>
119                 <td>
120                     <emphasis role="bold">rational</emphasis>
121                 </td>
122                 <td>
123                     <varname>object</varname> é uma matriz ou hipermatriz de
124                     <link linkend="rational">razões </link>
125                     de polinômios (matriz de transferência), com coeficientes
126                     reais ou complexos.
127                 </td>
128             </tr>
129             <tr>
130                 <td>
131                     <emphasis role="bold">handle</emphasis>
132                 </td>
133                 <td>
134                     <varname>object</varname> is a graphics
135                     <link linkend="graphics_entities">handle</link>.
136                     The subtype of graphics handles (Figure, Axes, Polyline,
137                     Compound, etc) is available in their <literal>.type</literal>
138                     property. See examples below.
139                 </td>
140             </tr>
141             <tr>
142                 <td>
143                     <emphasis role="bold">list</emphasis>
144                 </td>
145                 <td>
146                     <varname>object</varname> é uma
147                     <link linkend="list">lista</link>.
148                 </td>
149             </tr>
150             <tr>
151                 <td>
152                     <emphasis role="bold">st</emphasis>
153                 </td>
154                 <td>
155                     <varname>object</varname> é uma
156                     <link linkend="struct">estrutura</link> ou
157                     um nD-array de estruturas.
158                 </td>
159             </tr>
160             <tr>
161                 <td>
162                     <emphasis role="bold">ce</emphasis>
163                 </td>
164                 <td>
165                     <varname>object</varname> é uma célula
166                     ou um nD-array de <link linkend="cell">células</link>.
167                 </td>
168             </tr>
169             <tr>
170                 <td>
171                     <emphasis role="bold">boolean sparse</emphasis>
172                 </td>
173                 <td>
174                     <varname>object</varname> é uma matriz de valores
175                     <link linkend="sparse">booleanos esparsa</link>.
176                     <warning>Sparse boolean hypermatrices are not supported.
177                     </warning>
178                 </td>
179             </tr>
180             <tr>
181                 <td>
182                     <emphasis role="bold">sparse</emphasis>
183                 </td>
184                 <td>
185                     <varname>object</varname> é uma matriz
186                     <link linkend="sparse">esparsa</link> de números
187                     reais ou complexos.
188                     <warning>Sparse numerical hypermatrices are not supported.</warning>
189                 </td>
190             </tr>
191             <tr>
192                 <td>
193                     <emphasis role="bold">"Matlab sparse"</emphasis>
194                 </td>
195                 <td>
196                     <varname>object</varname> is a Matlab-like-encoded sparse
197                     matrix (see <link linkend="mtlb_sparse">mtlb_sparse()</link>).
198                 </td>
199             </tr>
200             <tr>
201                 <td>
202                     <emphasis role="bold">fptr</emphasis>
203                 </td>
204                 <td>
205                     <varname>object</varname> is a built-in Scilab function,
206                     called also <emphasis role="italic">gateway</emphasis>
207                     (C, C++ or Fortran code), a.k.a. a primitive.
208                 </td>
209             </tr>
210             <tr>
211                 <td>
212                     <emphasis role="bold">function</emphasis>
213                 </td>
214                 <td>
215                     <varname>object</varname> is a <link linkend="function">function</link>
216                     (Scilab code). See also <link linkend="deff">deff</link>.
217                 </td>
218             </tr>
219             <tr>
220                 <td>
221                     <emphasis role="bold">library</emphasis>
222                 </td>
223                 <td>
224                     <varname>object</varname> is a
225                     <link linkend="library">library</link>
226                     of functions in Scilab language.
227                 </td>
228             </tr>
229             <tr>
230                 <td>
231                     <emphasis role="bold">pointer</emphasis>
232                 </td>
233                 <td>
234                     <varname>object</varname> é um ponteiro (ver
235                     <link linkend="lufact">lufact</link>).
236                 </td>
237             </tr>
238             <tr>
239                 <td>
240                     <emphasis role="bold">implicitlist</emphasis>
241                 </td>
242                 <td>
243                     <varname>object</varname> é um polinômio de tamanho
244                     implícito para indexação.
245                     Ver  <link linkend="dollar">n:$</link> e
246                     <link linkend="colon">: (colon)</link>
247                 </td>
248             </tr>
249             <tr>
250                 <td>
251                     <emphasis role="bold">listdelete</emphasis>
252                 </td>
253                 <td>
254                     is returned by 
255                     <function>
256                         typeof(<literal>null()</literal>)
257                     </function>
258                     .
259                     See  <link linkend="null">null()</link>.
260                 </td>
261             </tr>
262             <tr>
263                 <td>
264                     <emphasis role="bold">void</emphasis>
265                 </td>
266                 <td>is the typeof undefined elements in lists.
267                 </td>
268             </tr>
269             <tr>
270                 <td colspan="2"></td>
271             </tr>
272             <tr><td colspan="2">
273                     <emphasis role="bold italic">Typed T-Lists or M-Lists:</emphasis>
274                 </td>
275             </tr>
276             <tr><td colspan="2">
277                     Note that if the <varname>object</varname> is a
278                     <link linkend="tlist">tlist</link>
279                     or a <link linkend="mlist">mlist</link>, <function>typeof</function>
280                     will return the corresponding customized type stored in as a
281                     string in the first list entry.
282                 </td>
283             </tr>
284             <tr>
285                 <td colspan="2"></td>
286             </tr>
287             <tr><td colspan="2">
288                     <emphasis role="bold italic">Reserved T-List or M-List types
289                         predefined in Scilab:
290                     </emphasis>
291                 </td>
292             </tr>
293             <tr>
294                 <td>
295                     <emphasis role="bold">dir</emphasis>
296                 </td>
297                 <td>
298                     <varname>object</varname> is the result of a
299                     <link linkend="dir">dir()</link>
300                     instruction, with fields <literal>name</literal>, <literal>date</literal>,
301                     <literal>bytes</literal>, and <literal>isdir</literal>.
302                 </td>
303             </tr>
304             <tr>
305                 <td>
306                     <emphasis role="bold">state-space</emphasis>
307                 </td>
308                 <td>
309                     <varname>object</varname> is a state-space model
310                     (see <link linkend="syslin">syslin</link>).
311                 </td>
312             </tr>
313             <tr>
314                 <td>
315                     <emphasis role="bold">XMLDoc</emphasis>
316                 </td>
317                 <td>
318                     <varname>object</varname> is an XML Document created with
319                     <link linkend="xmlRead">xmlRead</link>,
320                     <link linkend="xmlReadStr">xmlReadStr</link>,
321                     <link linkend="htmlRead">htmlRead</link>, or
322                     <link linkend="htmlReadStr">htmlReadStr</link>.
323                     Additional XML typeof are defined.
324                 </td>
325             </tr>
326             <tr>
327                 <td>
328                     <emphasis role="bold">H5Object</emphasis>
329                 </td>
330                 <td>
331                     <varname>object</varname> is the id of an HDF5 file opened
332                     with <link linkend="h5open">h5open</link>.
333                     Additional HDF5 typeof are defined:
334                     See <link linkend="h5objects">HDF5 Objects</link>.
335                 </td>
336             </tr>
337             <tr>
338                 <td>
339                     <emphasis role="bold">uitree</emphasis>
340                 </td>
341                 <td>
342                     <varname>object</varname> is a tree, a branch or a leaf as created with  a
343                     uitree feature. See for instance <link linkend="uiCreateNode">uiCreateNode</link>.
344                 </td>
345             </tr>
346         </table>
347     </refsection>
348     <refsection role="examples">
349         <title>Exemplos</title>
350         <programlisting role="no-scilab-exec"><![CDATA[
351 // Characters and texts
352 t = ["a" "Hello"   "à é è ï ô û ñ"
353      "1" "Bonjour" "указывает тип объекта"
354      ";" "Chao"    "オブジェクトの型"
355     ]
356 typeof(t)
357
358 // Booleans
359 typeof(%t)
360 typeof("abc"=="def")
361 hm = grand(2,2,2,"uin",0,9)<5
362 typeof(hm)
363
364 // Encoded integers
365 [ typeof(uint8(%pi))  typeof(int8(-%pi))
366   typeof(uint16(%pi)) typeof(int16(-%pi))
367   typeof(uint32(%pi)) typeof(int32(-%pi))
368   typeof(uint64(%pi)) typeof(int64(-%pi))
369 ]
370
371 // Decimal numbers
372 n = 1:0.3:2
373 typeof(n)
374 hm = grand(2,2,2,"uin",0,9)
375 typeof(hm)
376
377 // Decimal integers
378 n = 1:7
379 typeof(n)
380
381 // Complex numbers
382 n = [%i 1-%i %pi - 3*%i]
383 typeof(n)
384
385 // Special "constant"
386 typeof([])   // empty matrix
387
388 // Polynomials
389 n = [ %z (1-%z)^2]
390 typeof(n)
391 n = [ 3*%i + %z (1-%i*%z)^2]
392 typeof(n)
393
394 // Rational fractions
395 r = [%s/(1-%s) (1+%s)^2/(1-%s)]   // with real coefficients
396 typeof(r)
397 r = [%s/(%i-%s) (%i+%s)^2/(1-%s)] // with complex coefficients
398 typeof(r)
399
400 // Sparse matrices
401 // ---------------
402 w = sprand(100,100,0.001)
403 typeof(w)     // sparse
404 typeof(w==w)  // boolean sparse
405 //x = mtlb_sparse(sprand(10,10,0.1));
406 //typeof(x)
407
408 // Functions and libraries
409 // -----------------------
410 deff('y=f(x)','y=2*x');  // Function in Scilab language
411 f(%pi)
412 typeof(f)
413 typeof(cosd)  // written in Scilab
414
415 typeof(corelib) // Library of functions in Scilab language
416
417 typeof(sin)     // Built-in function (non-editable)
418 mysin = sin;
419 mysin(%pi/2)
420
421 // Graphical handles
422 // -----------------
423 clf
424 plot2d()
425 typeof(gcf())
426 // The subtype of the handle is in the "type" property:
427 gcf().type
428 gca().type
429 gce().type
430
431 close(gcf())
432
433 // Containers
434 // ----------
435 // Simple list
436 L = list(%pi, %t, %z, %s/(1-%s), "Bonjour", sin, cosd, list("list_in_list", 432));
437 typeof(L)
438
439 // Cells array
440 C = {%pi, %t, %z ; %s/(1-%s), "Bonjour", list("list_in_list", 432) }
441 typeof(C)
442
443 // (Array of) Structure
444 S.num = %pi;
445 S.b = %t;
446 S(2).t = "Bonjour"
447 typeof(S)
448
449 // Special generic indexing expressions
450 // ------------------------------------
451 typeof($)
452 typeof(:)    // "eye()" equivalent (all elements)
453 typeof(3:$)
454
455 // Typeof for deletion or undefined elements:
456 // -----------------------------------------
457 typeof([])      // empty matrix
458 typeof(null())
459 L = list(%pi, ,"hey!")
460 typeof(L(2))   // undefined element
461
462 // Customized typeof of T-Lists:
463 // ----------------------------
464 L = tlist(['myLongTypeOf','a','b'], 18, 'Scilab');
465 typeof(L)
466
467 // Reserved T-List typeof
468 // ----------------------
469 typeof(dir())  // files directory
470
471 doc = xmlReadStr("<root><a att=""foo"">Hello</a></root>");
472 typeof(doc)
473 xmlDelete(doc)
474
475 x = 1;
476 save(TMPDIR + "/x.sod", "x"); // SOD files are HDF5 ones
477 a = h5open(TMPDIR + "/x.sod");
478 typeof(a)
479 h5close(a)
480  ]]></programlisting>
481     </refsection>
482     <refsection role="see also">
483         <title>Ver Também</title>
484         <simplelist type="inline">
485             <member>
486                 <link linkend="type">type</link>
487             </member>
488             <member>
489                 <link linkend="inttype">inttype</link>
490             </member>
491             <member>
492                 <link linkend="overloading">overloading</link>
493             </member>
494             <member>
495                 <link linkend="isreal">isreal</link>
496             </member>
497             <member>
498                 <link linkend="strings">strings</link>
499             </member>
500             <member>
501                 <link linkend="poly">poly</link>
502             </member>
503             <member>
504                 <link linkend="rlist">rlist</link>
505             </member>
506             <member>
507                 <link linkend="null">null</link>
508             </member>
509             <member>
510                 <link linkend="sparse">sparse</link>
511             </member>
512             <member>
513                 <link linkend="issparse">issparse</link>
514             </member>
515             <member>
516                 <link linkend="mtlb_sparse">mtlb_sparse</link>
517             </member>
518             <member>
519                 <link linkend="syslin">syslin</link>
520             </member>
521             <member>
522                 <link linkend="dir">dir</link>
523             </member>
524             <member>
525                 <link linkend="XMLObjects">XML Objects</link>
526             </member>
527             <member>
528                 <link linkend="h5objects">HDF5 Objects</link>
529             </member>
530         </simplelist>
531     </refsection>
532     <refsection role="history">
533         <title>Histórico</title>
534         <revhistory>
535             <revision>
536                 <revnumber>6.0</revnumber>
537                 <revdescription>
538                     <itemizedlist>
539                         <listitem>"overload" keyword added. </listitem>
540                         <listitem>typeof "uint64" and "int64" added. </listitem>
541                         <listitem>typeof "hypermat" removed. Hypermatrices of any homogeneous type are now
542                             natively supported.
543                         </listitem>
544                         <listitem>typeof "listdelete" and "void" added.</listitem>
545                         <listitem>typeof(:) was "constant" and becomes "implicitlist". typeof(1:$) was
546                             "size implicit" and become "implicitlist".
547                         </listitem>
548                         <listitem>The typeof of T-lists and M-lists were limited to 8 characters. They may
549                             be longer now.
550                         </listitem>
551                         <listitem>
552                             typeof "size implicit" renamed "implicitlist" (<literal>1:$</literal>)
553                         </listitem>
554                         <listitem>Help page reviewed.</listitem>
555                     </itemizedlist>
556                 </revdescription>
557             </revision>
558         </revhistory>
559     </refsection>
560 </refentry>