Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.1 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Sparses Matrix > Linear Equations (Iterative Solvers) > gmres

gmres

Generalized Minimum RESidual 法

呼び出し手順

[x,flag,err,iter,res] = gmres(A,b,[rstr,[tol,[maxi,[M,[x0]]]]])

引数

A

n行n列行列またはA*xを返す関数. Aが関数の場合,以下のようなヘッダを有すること:

function y=A(x)
b

右辺ベクトル

x0

初期推定値ベクトル(デフォルト: zeros(n,1))

M

プリコンディショナ: n行n列行列(デフォルト: eye(n,n))または M*xを返す関数. M が関数の場合,以下のようなヘッダを有すること:

function y=M(x)
rstr

リスタートまでの反復回数 (デフォルト: 10)

maxi

最大反復回数 (デフォルト: n)

tol

許容誤差 (デフォルト: 1e-6)

x

解のベクトル

err

最終残差ノルム

iter

実行した反復回数

flag
0 =

gmresは, maxi回の反復内に 指定した許容誤差に収束しました

1 =

指定した maxi回では収束しませんでした

res

残差ベクトル

説明

GMRES

線形システムAx=bをリスタート付きの Generalized Minimal residual法により解きます.

詳細

このアルゴリズムの詳細は以下の文献に記述されています :

"Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods", Barrett, Berry, Chan, Demmel, Donato, Dongarra, Eijkhout, Pozo, Romine, and Van der Vorst, SIAM Publications, 1993 (ftp netlib2.cs.utk.edu; cd linalg; get templates.ps).

"Iterative Methods for Sparse Linear Systems, Second Edition" Saad, SIAM Publications, 2003 (ftp ftp.cs.umn.edu; cd dept/users/saad/PS; get all_ps.zip).

// A および M が行列の場合
A=[ 94  0   0   0    0   28  0   0   32  0
    0   59  13  5    0   0   0   10  0   0
    0   13  72  34   2   0   0   0   0   65
    0   5   34  114  0   0   0   0   0   55
    0   0   2   0    70  0   28  32  12  0
    28  0   0   0    0   87  20  0   33  0
    0   0   0   0    28  20  71  39  0   0
    0   10  0   0    32  0   39  46  8   0
    32  0   0   0    12  33  0   8   82  11
    0   0   65  55   0   0   0   0   11  100];
b=ones(10,1);
[x,flag,err,iter,res] = gmres(A, b)
M = eye(10, 10);
[x,flag,err,iter,res] = gmres(A, b, 10, 1d-12, 20, M, zeros(10, 1))
// Aが行列, Mが関数の場合
A=[ 94  0   0   0    0   28  0   0   32  0
    0   59  13  5    0   0   0   10  0   0
    0   13  72  34   2   0   0   0   0   65
    0   5   34  114  0   0   0   0   0   55
    0   0   2   0    70  0   28  32  12  0
    28  0   0   0    0   87  20  0   33  0
    0   0   0   0    28  20  71  39  0   0
    0   10  0   0    32  0   39  46  8   0
    32  0   0   0    12  33  0   8   82  11
    0   0   65  55   0   0   0   0   11  100];
b=ones(10,1);
function y=Mtimesx(x)
M = eye(10,10);
y = M*x;
endfunction
[x,flag,err,iter,res] = gmres(A, b, 10, 1d-12, 20, Mtimesx, zeros(10, 1))
// A が関数, M が行列の場合
function y=Atimesx(x)
A=[ 94  0   0   0    0   28  0   0   32  0
    0   59  13  5    0   0   0   10  0   0
    0   13  72  34   2   0   0   0   0   65
    0   5   34  114  0   0   0   0   0   55
    0   0   2   0    70  0   28  32  12  0
    28  0   0   0    0   87  20  0   33  0
    0   0   0   0    28  20  71  39  0   0
    0   10  0   0    32  0   39  46  8   0
    32  0   0   0    12  33  0   8   82  11
    0   0   65  55   0   0   0   0   11  100];
 y = A * x;
 endfunction
 b = ones(10,1);
 M = eye(10, 10);
 [x,flag,err,iter,res] = gmres(Atimesx, b)
 [x,flag,err,iter,res] = gmres(Atimesx, b, 10, 1d-12, 20, M, zeros(10,1))
 // A および M が関数
 function y=Atimesx(x)
A=[ 94  0   0   0    0   28  0   0   32  0
    0   59  13  5    0   0   0   10  0   0
    0   13  72  34   2   0   0   0   0   65
    0   5   34  114  0   0   0   0   0   55
    0   0   2   0    70  0   28  32  12  0
    28  0   0   0    0   87  20  0   33  0
    0   0   0   0    28  20  71  39  0   0
    0   10  0   0    32  0   39  46  8   0
    32  0   0   0    12  33  0   8   82  11
    0   0   65  55   0   0   0   0   11  100];
 y = A * x;
 endfunction
 function y=Mtimesx(x)
M = eye(10,10);
y = M*x;
endfunction
 [x,flag,err,iter,res] = gmres(Atimesx, b, 10, 1d-12, 20, Mtimesx, zeros(10,1))

参照

  • conjgrad — 共役勾配ソルバ
  • qmr — プリコンディショナ付きのQuasi Minimal Residual法
Report an issue
<< conjgrad Linear Equations (Iterative Solvers) qmr >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:37:51 CET 2022