257fea53a19e185a41d372d671573dc81f8e5cb0
[scilab.git] / scilab / modules / core / help / ja_JP / 1_keywords / backslash.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <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" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="backslash">
3     <refnamediv>
4         <refname>backslash</refname>
5         <refpurpose>(\) 左行列除算.</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>呼び出し手順</title>
9         <synopsis>x=A\b</synopsis>
10     </refsynopsisdiv>
11     <refsection>
12         <title>説明</title>
13         <para>
14             バックスラッシュは左行列除算を定義します. 
15             <literal>x=A\b</literal> は <literal>A*x=b</literal>の解です.
16         </para>
17         <para>
18             <literal>A</literal> が正方で非特異の場合,
19             <literal>x=A\b</literal> (唯一の解) は <literal>x=inv(A)*b</literal> 
20             と等価です(しかし,計算コストははるかに小さくなります).
21         </para>
22         <para>
23             <literal>A</literal> が正方でない場合, <literal>x</literal> は最小二乗解となります.
24             すなわち, <literal>norm(A*x-b)</literal> は最小値 (ユークリッドノルム)となります. <literal>A</literal> が列フルランクの場合,最小二乗解, <literal>x=A\b</literal>, は
25             唯一の解 (<literal>norm(A*x-b)</literal>を最小化する唯一の
26             <literal>x</literal>が存在)となります.
27             <literal>A</literal> が列フルランクでない場合, 最小二乗解は唯一ではなくなり,
28             <literal>x=A\b</literal>は一般に最小ノルム解ではなくなります
29             (最小ノルム解は <literal>x=pinv(A)*b</literal>です).
30         </para>
31         <para>
32             <literal>A.\B</literal>  は<literal>(i,j)</literal> エントリが
33             <literal>A(i,j)\B(i,j)</literal>となる行列となります.
34             <literal>A.\B</literal> は
35             <literal>A*ones(B).\B</literal> (または <literal>A.\(B*ones(A))</literal>
36             と等価になります.
37         </para>
38         <para>
39             <literal>A\.B</literal>  は定義されていない演算子です.
40             この演算子は, * または /.のように新しい演算子を定義する際に使用できます(オーバーロード参照).
41         </para>
42     </refsection>
43     <refsection>
44         <title>例</title>
45         <programlisting role="example"><![CDATA[ 
46 A=rand(3,2);b=[1;1;1]; x=A\b; y=pinv(A)*b;  x-y
47 A=rand(2,3);b=[1;1]; x=A\b; y=pinv(A)*b; x-y, A*x-b, A*y-b
48 A=rand(3,1)*rand(1,2); b=[1;1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b
49 A=rand(2,1)*rand(1,3); b=[1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b 
50
51 // A benchmark of several linear solvers
52
53 [A,descr,ref,mtype] = ReadHBSparse(SCI+"/modules/umfpack/examples/bcsstk24.rsa"); 
54
55 b = zeros(size(A,1),1);
56
57 tic();
58 res = umfpack(A,'\',b);
59 mprintf('\ntime needed to solve the system with umfpack: %.3f\n',toc());
60
61 tic();
62 res = linsolve(A,b);
63 mprintf('\ntime needed to solve the system with linsolve: %.3f\n',toc());
64
65 tic();
66 res = A\b;
67 mprintf('\ntime needed to solve the system with the backslash operator: %.3f\n',toc());
68  ]]></programlisting>
69     </refsection>
70     <refsection role="see also">
71         <title>参照</title>
72         <simplelist type="inline">
73             <member>
74                 <link linkend="slash">slash</link>
75             </member>
76             <member>
77                 <link linkend="inv">inv</link>
78             </member>
79             <member>
80                 <link linkend="pinv">pinv</link>
81             </member>
82             <member>
83                 <link linkend="percent">percent</link>
84             </member>
85             <member>
86                 <link linkend="ieee">ieee</link>
87             </member>
88             <member>
89                 <link linkend="linsolve">linsolve</link>
90             </member>
91             <member>
92                 <link linkend="umfpack">umfpack</link>
93             </member>
94         </simplelist>
95     </refsection>
96 </refentry>