94c17ed1c31dfa3d1148133a87f632aed382edce
[scilab.git] / scilab / modules / linear_algebra / help / ja_JP / factorization / householder.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 - 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" 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="householder">
18     
19     <refnamediv>
20         <refname>householder</refname>
21         <refpurpose>ハウスホルダー直交鏡映行列</refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>呼び出し手順</title>
25         <synopsis>         householder         // demo</synopsis>
26         <synopsis> u     = householder(v [,w])</synopsis>
27         <synopsis>[u, H] = householder(v [,w])</synopsis>
28     </refsynopsisdiv>
29     <refsection role="arguments">
30         <title>引数</title>
31         <variablelist>
32             <varlistentry>
33                 <term>v</term>
34                 <listitem>
35                     <para>実数または複素数の列ベクトル</para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>w</term>
40                 <listitem>
41                     <para>
42                         <literal>v</literal>と同じ大きさの実数または複素数の列ベクトル.
43                         デフォルト値は<literal>eye(v)</literal>((Ox) axis).
44                     </para>
45                 </listitem>
46             </varlistentry>
47             <varlistentry>
48                 <term>u</term>
49                 <listitem>
50                     <para>
51                         unit vector lying in the <literal>(v,w)</literal> plane and orthogonal
52                         to the bisectrix of <literal>(v,w)</literal>.
53                         Column of size(v) of real or complex numbers.
54                     </para>
55                 </listitem>
56             </varlistentry>
57             <varlistentry>
58                 <term>H</term>
59                 <listitem>
60                     <para>
61                         Orthogonal Householder reflexion matrix: <literal>H= eye() - 2*u*u'</literal>.
62                         <varname>H</varname> is such that <literal>inv(H)==H</literal>,
63                         <literal>H'==H</literal>, and <literal>det(H)==-1</literal>.
64                     </para>
65                     <para>
66                         If <varname>v</varname> and <varname>w</varname> are real,
67                         <literal>H*v</literal> is proportional to <varname>w</varname>.
68                     </para>
69                 </listitem>
70             </varlistentry>
71         </variablelist>
72     </refsection>
73     <refsection role="description">
74         <title>説明</title>
75         <para>
76             <literal>householder(..)</literal> computes the unit vector <varname>u</varname>
77             lying in the <literal>(v,w)</literal> plane and orthogonal to the bisectrix of
78             <literal>(v,w)</literal>.
79         </para>
80         <para>
81             If <varname>v</varname> and <varname>w</varname> are proportional:
82             <itemizedlist>
83                 <listitem>
84                     <para>
85                         If they are opposite, <literal>u= v/|v|</literal> is returned.
86                     </para>
87                 </listitem>
88                 <listitem>
89                     If they are real and have the same direction, <varname>u</varname> is set
90                     in the (xOy) plane with a priori <literal>u(1)>0</literal>, and orthogonal to
91                     <varname>v</varname> (<literal>u'*v==0</literal>). However,
92                     <itemizedlist>
93                         <listitem>
94                             If they are along (Ox), <literal>u = (Oy+)</literal> is returned instead.
95                         </listitem>
96                         <listitem>
97                             If <varname>v</varname> and <varname>w</varname> are scalars with same
98                             signs, the orthogonal sub-space is restricted to <literal>{0}</literal>
99                             that can't be normalized:
100                             <varname>u</varname> and <varname>H</varname> are then set to
101                             <literal>%nan</literal>.
102                         </listitem>
103                     </itemizedlist>
104                 </listitem>
105             </itemizedlist>
106         </para>
107         
108         <para>
109             If the related reflexion matrix <varname>H</varname> is computed, for any point A
110             of column coordinates <literal>a</literal>, <literal>H*a</literal> are the coordinates of
111             the reflected image of A on P.
112         </para>
113         <note>
114             If <varname>v</varname> or/and <varname>w</varname> are in row, they are priorly
115             transposed into columns.
116         </note>
117         <warning>
118             If <varname>v</varname> or/and <varname>w</varname> are <literal>[]</literal>,
119             <literal>[]</literal> is returned for <varname>u</varname> and <varname>H</varname>.
120         </warning>
121     </refsection>
122     <refsection role="examples">
123         <title>例</title>
124         <programlisting role="example"><![CDATA[
125 a = [ rand(1,1) 0  0 ]';
126 [ra hm] = householder(a);
127 [a ra hm*a ]
128 norm(ra)
129
130 b = rand(3,1);
131 [rb, hm] = householder(b);
132 [b rb eye(b) clean(hm*b) ]
133 norm(rb)
134
135 [rb2b, hm] = householder(b, 2*b);
136 [b rb2b clean(hm*b ./ b) ]  // last column must be uniform
137 norm(rb2b)                  // must be 1
138
139 c = rand(3,1);
140 [rbc, hm] = householder(b,c);
141 norm(rbc)          // must be 1
142 hm*b ./c           // must be uniform
143
144 d = b + %i*c;
145 e = rand(3,1) + %i*rand(3,1);
146 [rde, hm] = householder(d,e);
147 norm(rbc)               // must be 1
148 clean(inv(hm) - hm)     // must be zeros(3,3)
149 clean(hm' - hm)         // must be zeros(3,3)
150 clean(det(hm))          // must be -1
151  ]]></programlisting>
152         
153         <para>APPLICATION : Reflected image of an object</para>
154         <programlisting role="example"><![CDATA[
155 // (OA) = [0 0 1] is reflected in O into (OB) = [ 1 1 0.3 ]:
156 [n, H] = householder([0 0 1]', [ 1 1 0.3 ]');
157 // "n" is the unit vector orthogonal to the reflecting plane
158
159 // Emitting object (feature from shell demo):
160 u = linspace(0,2*%pi,40);
161 v = linspace(0,2*%pi,20);
162 Xe = (cos(u).*u)'*(1+cos(v)/2)+10;
163 Ye = (u/2)'*sin(v);
164 Ze = (sin(u).*u)'*(1+cos(v)/2);
165
166 // Reflected object:
167 Pe = [ Xe(:)' ; Ye(:)' ; Ze(:)'];
168 Pr = H*Pe;
169 Xr = matrix(Pr(1,:),40,-1);
170 Yr = matrix(Pr(2,:),40,-1);
171 Zr = matrix(Pr(3,:),40,-1);
172
173 // Reflecting plane containing O: n(1).x + n(2).y + n(3).z = 0
174 //   Sampling space:
175 x = linspace(min([Xe(:);Xr(:)]), max([Xe(:);Xr(:)]),20);
176 y = linspace(min([Ye(:);Yr(:)]), max([Ye(:);Yr(:)]),20);
177 [X, Y] = meshgrid(x,y);
178 //   Generating the mirror:
179 deff("z = mirror(x,y,n)","z = -n(1)/n(3)*x - n(2)/n(3)*y")
180 Zm = mirror(X,Y,n);
181
182 // Plotting:
183 clf
184 drawlater
185 f = gcf();
186 f.color_map = [ 0.8 0.8 0.8 ; jetcolormap(100)];
187 surf(Xe,Ye,Ze)
188 surf(X,Y,Zm)
189 surf(Xr,Yr,Zr)
190 a = gca();
191 a.isoview = "on";
192 a.rotation_angles = [74 123];
193 a.children.color_flag = 0;
194 a.children.color_mode = 0;
195 a.children(1).foreground = color("red");
196 a.children(2).foreground = 1;
197 a.children(3).foreground = color("green");
198 drawnow
199  ]]></programlisting>
200         <scilab:image>
201             householder();
202         </scilab:image>
203     </refsection>
204     
205     <refsection role="see also">
206         <title>参照</title>
207         <simplelist type="inline">
208             <member>
209                 <link linkend="qr">qr</link>
210             </member>
211             <member>
212                 <link linkend="givens">givens</link>
213             </member>
214         </simplelist>
215         
216     </refsection>
217     <refsection role="history">
218         <title>履歴</title>
219         <revhistory>
220             <revision>
221                 <revnumber>6.0</revnumber>
222                 <revdescription>
223                     <para>Householder reflexion matrix added as second output parameter.
224                         Demo householder() added. Help page reviewed.
225                     </para>
226                 </revdescription>
227             </revision>
228         </revhistory>
229     </refsection>
230     
231 </refentry>