1 <?xml version="1.0" encoding="UTF-8"?>
4 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5 * Copyright (C) XXXX-2008 - INRIA
7 * This file must be used under the terms of the CeCILL.
8 * This source file is licensed as described in the file COPYING, which
9 * you should have received as part of this distribution. The terms
10 * are also available at
11 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
15 <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="gmres">
19 <refname>gmres</refname>
21 <refpurpose>Generalized Minimum RESidual 法</refpurpose>
29 <synopsis>[x,flag,err,iter,res] = gmres(A,b,[rstr,[tol,[maxi,[M,[x0]]]]])</synopsis>
47 n行n列行列または<literal>A*x</literal>を返す関数.
49 <literal>A</literal>が関数の場合,以下のようなヘッダを有すること:
53 <programlisting role=""><![CDATA[
79 <para>初期推定値ベクトル(デフォルト: zeros(n,1))</para>
93 プリコンディショナ: n行n列行列(デフォルト: eye(n,n))または
95 <literal>M*x</literal>を返す関数.
97 M が関数の場合,以下のようなヘッダを有すること:
101 <programlisting role=""><![CDATA[
115 <para>リスタートまでの反復回数 (デフォルト: 10)</para>
127 <para>最大反復回数 (デフォルト: n)</para>
139 <para>許容誤差 (デフォルト: 1e-6)</para>
175 <para>実行した反復回数</para>
197 <literal>gmres</literal>は,
199 <literal>maxi</literal>回の反復内に
217 指定した <literal>maxi</literal>回では収束しませんでした
261 線形システム<literal>Ax=b</literal>をリスタート付きの
263 Generalized Minimal residual法により解きます.
277 <para>このアルゴリズムの詳細は以下の文献に記述されています :</para>
279 <para>"Templates for the Solution of Linear Systems: Building Blocks for
281 Iterative Methods", Barrett, Berry, Chan, Demmel, Donato, Dongarra,
283 Eijkhout, Pozo, Romine, and Van der Vorst, SIAM Publications, 1993 (ftp
285 netlib2.cs.utk.edu; cd linalg; get templates.ps).
289 <para>"Iterative Methods for Sparse Linear Systems, Second Edition" Saad,
291 SIAM Publications, 2003 (ftp ftp.cs.umn.edu; cd dept/users/saad/PS; get
309 <programlisting role="example"><![CDATA[
311 A=[ 94 0 0 0 0 28 0 0 32 0
312 0 59 13 5 0 0 0 10 0 0
313 0 13 72 34 2 0 0 0 0 65
314 0 5 34 114 0 0 0 0 0 55
315 0 0 2 0 70 0 28 32 12 0
316 28 0 0 0 0 87 20 0 33 0
317 0 0 0 0 28 20 71 39 0 0
318 0 10 0 0 32 0 39 46 8 0
319 32 0 0 0 12 33 0 8 82 11
320 0 0 65 55 0 0 0 0 11 100];
322 [x,flag,err,iter,res] = gmres(A, b)
324 [x,flag,err,iter,res] = gmres(A, b, 10, 1d-12, 20, M, zeros(10, 1))
326 A=[ 94 0 0 0 0 28 0 0 32 0
327 0 59 13 5 0 0 0 10 0 0
328 0 13 72 34 2 0 0 0 0 65
329 0 5 34 114 0 0 0 0 0 55
330 0 0 2 0 70 0 28 32 12 0
331 28 0 0 0 0 87 20 0 33 0
332 0 0 0 0 28 20 71 39 0 0
333 0 10 0 0 32 0 39 46 8 0
334 32 0 0 0 12 33 0 8 82 11
335 0 0 65 55 0 0 0 0 11 100];
337 function y = Mtimesx(x)
341 [x,flag,err,iter,res] = gmres(A, b, 10, 1d-12, 20, Mtimesx, zeros(10, 1))
343 function y = Atimesx(x)
344 A=[ 94 0 0 0 0 28 0 0 32 0
345 0 59 13 5 0 0 0 10 0 0
346 0 13 72 34 2 0 0 0 0 65
347 0 5 34 114 0 0 0 0 0 55
348 0 0 2 0 70 0 28 32 12 0
349 28 0 0 0 0 87 20 0 33 0
350 0 0 0 0 28 20 71 39 0 0
351 0 10 0 0 32 0 39 46 8 0
352 32 0 0 0 12 33 0 8 82 11
353 0 0 65 55 0 0 0 0 11 100];
358 [x,flag,err,iter,res] = gmres(Atimesx, b)
359 [x,flag,err,iter,res] = gmres(Atimesx, b, 10, 1d-12, 20, M, zeros(10,1))
361 function y = Atimesx(x)
362 A=[ 94 0 0 0 0 28 0 0 32 0
363 0 59 13 5 0 0 0 10 0 0
364 0 13 72 34 2 0 0 0 0 65
365 0 5 34 114 0 0 0 0 0 55
366 0 0 2 0 70 0 28 32 12 0
367 28 0 0 0 0 87 20 0 33 0
368 0 0 0 0 28 20 71 39 0 0
369 0 10 0 0 32 0 39 46 8 0
370 32 0 0 0 12 33 0 8 82 11
371 0 0 65 55 0 0 0 0 11 100];
374 function y = Mtimesx(x)
378 [x,flag,err,iter,res] = gmres(Atimesx, b, 10, 1d-12, 20, Mtimesx, zeros(10,1))
383 <refsection role="see also">
387 <simplelist type="inline">
391 <link linkend="conjgrad">conjgrad</link>
397 <link linkend="qmr">qmr</link>