%i_isreal() %i_real() %i_imag() added
[scilab.git] / scilab / modules / data_structures / help / ja_JP / types / type.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) INRIA
5  * Copyright (C) 2017 - Samuel GOUGEON
6  *
7  * Copyright (C) 2012 - 2016 - Scilab Enterprises
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15  *
16  -->
17 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18     xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19     xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20     xml:lang="ja" xml:id="type">
21     <refnamediv>
22         <refname>type</refname>
23         <refpurpose>変数の型を返す</refpurpose>
24     </refnamediv>
25     <refsynopsisdiv>
26         <title>呼び出し手順</title>
27         <synopsis>[i]=type(x)</synopsis>
28     </refsynopsisdiv>
29     <refsection>
30         <title>パラメータ</title>
31         <variablelist>
32             <varlistentry>
33                 <term>x</term>
34                 <listitem>
35                     <para>Scilab オブジェクト</para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>i</term>
40                 <listitem>
41                     <para>整数</para>
42                 </listitem>
43             </varlistentry>
44         </variablelist>
45     </refsection>
46     <refsection>
47         <title>説明</title>
48         <para>
49             <literal>type(x)</literal>  は,以下のように
50             <literal>x</literal>の型の種類を整数で返します :
51         </para>
52         <para>
53             1
54             :  実数または複素数の定数行列.
55         </para>
56         <para>
57             2
58             :  多項式行列.
59         </para>
60         <para>
61             4
62             :  論理値行列.
63         </para>
64         <para>
65             5
66             :  疎行列.
67         </para>
68         <para>
69             6
70             :  論理値疎行列.
71         </para>
72         <para>
73             7
74             :  Matlab 疎行列.
75         </para>
76         <para>
77             8
78             :  1 2 4 または 8 バイトに保存される整数行列.
79         </para>
80         <para>
81             9
82             :  グラフィックハンドルの行列.
83         </para>
84         <para>
85             10
86             :  文字列の行列.
87         </para>
88         <para>
89             13
90             :  コンパイル済みの関数 (Scilab コード).
91         </para>
92         <para>
93             14
94             :  関数ライブラリ.
95         </para>
96         <para>
97             15
98             :  リスト.
99         </para>
100         <para>
101             16
102             :  型付リスト (tlist).
103         </para>
104         <para>
105             17
106             :  行列の型付リスト (mlist).
107         </para>
108         <para>
109             128
110             : Xcosブロックへのポインタ(参照)、<link linkend="lufact">lufact</link>()の結果へのポインタな.
111         </para>
112         <para>
113             129
114             : 添字に使用される暗黙の大きさの多項式.
115         </para>
116         <para>
117             130
118             : Scilab 内部コード (C または Fortran コード).
119         </para>
120         <para>0 :
121           An undefined element of a list (with a typeof <literal>void</literal>, such as
122           in the function call <literal>foo(a,,b)</literal>, or in
123           <literal>list(%pi,,%i,,,%z)</literal>), or a null object of typeof
124           <literal>listdelete</literal> returned by <literal>null()</literal>.
125         </para>
126         <refsect2>
127             <title>Remarks</title>
128             <para>
129                 Some data may be stored in custom containers defined as typed lists of type 16
130                 (tlist) or 17 (matrix-oriented typed mlist). This is also the case for embedded
131                 types like (<emphasis role="italic">rationals</emphasis>), structures
132                 (<emphasis role="italic">struct</emphasis>),
133                 <emphasis role="italic">state-space</emphasis>, interactive trees
134                 (<emphasis role="italic">uitree</emphasis>), etc, for which
135                 <literal>type(..)</literal> will return 16 or 17. One will use
136                 <link linkend="typeof">typeof</link> to get more information about their actual
137                 (sub)type.
138             </para>
139             <para>
140                 <emphasis role="bold">Type conversion in mixed operations</emphasis>:
141             </para>
142             <para>
143                 When a binary operator (like the multiplication) or an n-ary iterated one
144                 (like the concatenation) is applied beween two operands of distinct but
145                 compatible types, usually the type of one of both is implicitely converted,
146                 and the other operand sets the type of the result to its own type.
147                 <para>
148                     Examples with the <link linkend="brackets">concatenation</link> :
149                     <literal>[%t, 3.124]</literal>, <literal>[int8(5), 3.124]</literal>, etc.
150                 </para>
151                 <para>
152                 For the concatenation, addition, substraction, multiplication, division,
153                 and the power operation, the hierarchy between operands types is as follows
154                 (read "A &lt; B": B imposes its type to A) :
155                 <simplelist>
156                     <member>
157                         boolean &lt; (decimal number, complex encoded number)
158                     </member>
159                     <member>
160                         <warning>
161                             (decimal number, complex-encoded number) &lt; encoded integer.
162                         </warning>
163                     </member>
164                     <member>
165                         polynomial (real | complex) &lt; rational (real | complex)
166                     </member>
167                 </simplelist>
168                 </para>
169             </para>
170         </refsect2>
171     </refsection>
172     <refsection>
173         <title>Examples</title>
174         <programlisting role="example"><![CDATA[
175 // (Select some lines, right-click and choose "Execute.." to run the selection)
176 L = list(%pi,,"abc");
177 type(L(2))                  // undefined component of a list
178
179 type(42)                    // decimal numbers
180 type(%nan)
181 type(%inf)
182
183 type(1+%i)                  // complex numbers
184
185 s = sparse([1,2;4,5;3,10],[1,2,3]);
186 type(s)                     // sparse-encoded decimal or complex numbers
187
188 type(%t)                    // booleans
189
190 type(s>2)                   // sparse-encoded booleans
191
192 g = int8([1 -120 127 312]); // encoded integers
193 type(g)
194 type(1.23 * int8(4))
195
196 type(1-%z+%z^2)             // polynomials
197
198 type(gdf())                 // graphic handles
199
200 type("foo")                 // texts
201
202 deff('[x] = mymacro(y,z)',['a=3*y+1'; 'x=a*z+y']);
203 type(mymacro)               // Scilab functions
204
205 type(disp)                  // Built-in functions
206
207 l = list(1,["a" "b"]);      // simple lists
208 type(l)
209
210 e = tlist(["listtype","field1","field2"], [], []);
211 type(e)                     // Typed list
212
213 h = mlist(['V','name','value'],['a','b';'c' 'd'],[1 2; 3 4]);
214 type(h)                     // Typed matrix-oriented list
215
216 clear s, s.r = %pi          // structures
217 type(s)
218
219 c = {%t %pi %i %z "abc" s}  // cells
220 type(c)
221
222 r = [%z/(1-%z) (1-%z)/%z^2]
223 type(r)                     // rational fractions
224 ]]></programlisting>
225     </refsection>
226     <refsection role="see also">
227         <title>参照</title>
228         <simplelist type="inline">
229             <member>
230                 <link linkend="typeof">typeof</link>
231             </member>
232             <member>
233                 <link linkend="inttype">inttype</link>
234             </member>
235             <member>
236                 <link linkend="isreal">isreal</link>
237             </member>
238             <member>
239                 <link linkend="brackets">brackets</link>
240             </member>
241             <member>
242                 <link linkend="overloading">overloading</link>
243             </member>
244             <member>
245                 <link linkend="poly">poly</link>
246             </member>
247             <member>
248                 <link linkend="rational">rational</link>
249             </member>
250             <member>
251                 <link linkend="tlist">tlist</link>
252             </member>
253             <member>
254                 <link linkend="mlist">mlist</link>
255             </member>
256             <member>
257                 <link linkend="null">null</link>
258             </member>
259         </simplelist>
260     </refsection>
261     <refsection role="history">
262         <title>履歴</title>
263         <revhistory>
264             <revision>
265                 <revnumber>6.0</revnumber>
266                 <revdescription>
267                   The type 11 is removed. It was used for uncompiled Scilab functions.
268                 </revdescription>
269             </revision>
270         </revhistory>
271     </refsection>
272 </refentry>