<?xml version="1.0" encoding="EUC-JP"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/xhtml-mathll-f.dtd"
[
<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns = "http://www.w3.org/1999/xhtml" xml:lang="ja">
<head>
<title>odme012</title>
</head>
<body>
<p><br />
<br />
ＢＵＮＣＢＳ／Ｄ　（バンチの方法による対称バンド行列係数連立一次方程式の解法）<br />
<br />
Solution of Linear Equations with Symmetric Band Matrix of Coefficients
by Bunch's Method<br />
<br />
</p>
<table border="">
  <tbody>
    <tr valign="top">
      <td width="64" align="center">作　　成</td>
      <td width="560">二宮　市三　　1981年4月</td>
    </tr>
    <tr valign="top">
      <td width="64" align="center">形　　式</td>
      <td width="560">サブルーチン　言語;FORTRAN　サイズ;200,200行</td>
    </tr>
  </tbody>
</table>
<br />
（１）概　要<br />
　ＢＵＮＣＢＳ（Ｄ）は、必ずしも正値でない対称帯行列Ａを係数とし、複数個の右辺列Ｂを持つ連立一次方程式

<math xmlns="http://www.w3.org/1998/Math/MathML">AX=B</math>
 の解
<math xmlns="http://www.w3.org/1998/Math/MathML"> X=A<msup><mrow /><mrow><mstyle fontsize="6pt">-1</mstyle></mrow></msup>B</math>
 を、バンチの
<math xmlns="http://www.w3.org/1998/Math/MathML"> LD<msup><mrow>L</mrow><mrow>T</mrow></msup> </math>
分解法で求めるための単（倍）精度用のサブルーチン。
<math xmlns="http://www.w3.org/1998/Math/MathML"> LD<msup><mrow>L</mrow><mrow>T</mrow></msup> </math>
分解成分の再利用の機能を持つ。<br />
<br />
（２）使用法<br />
　ＣＡＬＬ　ＢＵＮＣＢＳ／Ｄ（Ａ，ＫＡ，Ｎ，ＮＢ，Ｘ，ＫＸ，Ｍ，ＣＨＧ，ＥＰＳ，ＩＷ，ＩＮＤ）
<center>
<table border="">
  <tbody>
    <tr valign="top">
      <td width="64" align="center">引　　数</td>
      <td width="80" align="center">型と種類＊</td>
      <td width="64" align="center">属　　性</td>
      <td width="496" align="center">内　　　　　　　　容</td>
    </tr>
    <tr valign="top">
      <td width="64">Ａ</td>
      <td width="80" align="center">実　数　型<br />
      ２次元配列</td>
      <td width="64" align="center">入出力</td>
      <td width="496">対称帯行列の対角線を含む左下半分を図のように長方形化して入力する。すなわち行列のＩ、Ｊ要素を
<math xmlns="http://www.w3.org/1998/Math/MathML">A(I-J+1，J)</math>
に入れる。本ルーチンで処理されて、バンチの分解成分が出力される。</td>
    </tr>
    <tr valign="top">
      <td width="64">ＫＡ</td>
      <td width="80" align="center">整　数　型</td>
      <td width="64" align="center">入　　力</td>
      <td width="496">Ａの整合寸法（Ａの配列宣言における第１添字の値）。ピボッティングのためにＡの帯幅は一般に増大するのでその分を見越して、ＫＡは十分大きく取っておく必要がある。
<math xmlns="http://www.w3.org/1998/Math/MathML">KA≧NB</math>
</td>
    </tr>
    <tr valign="top">
      <td width="64">Ｎ</td>
      <td width="80" align="center">整　数　型</td>
      <td width="64" align="center">入　　力</td>
      <td width="496">方程式の元数（Ａの列数）。
<math xmlns="http://www.w3.org/1998/Math/MathML">N≧1</math>
</td>
    </tr>
    <tr valign="top">
      <td width="64">ＮＢ</td>
      <td width="80" align="center">整　数　型</td>
      <td width="64" align="center">入出力</td>
      <td width="496">Ａの半帯幅（行数）を入力する。処理後の半帯幅が出力される。<br />
      
<math xmlns="http://www.w3.org/1998/Math/MathML">NB≧2</math>
</td>
    </tr>
    <tr valign="top">
      <td width="64">Ｘ</td>
      <td width="80" align="center">整　数　型<br />
      ２次元配列</td>
      <td width="64" align="center">入出力</td>
      <td width="496">右辺列を入力する。対応する場所に解ベクトルが出力される。</td>
    </tr>
    <tr valign="top">
      <td width="64">ＫＸ</td>
      <td width="80" align="center">整　数　型</td>
      <td width="64" align="center">入　　力</td>
      <td width="496">Ｘの整合寸法。
<math xmlns="http://www.w3.org/1998/Math/MathML">KX≧N</math>
</td>
    </tr>
    <tr valign="top">
      <td width="64">Ｍ</td>
      <td width="80" align="center">整　数　型</td>
      <td width="64" align="center">入　　力</td>
      <td width="496">Ｘの列数。
<math xmlns="http://www.w3.org/1998/Math/MathML">M≦0</math>
のときはＡの分解だけが行われる。</td>
    </tr>
    <tr valign="top">
      <td width="64">ＣＨＧ</td>
      <td width="80" align="center">実　数　型<br />
      １次元配列</td>
      <td width="64" align="center">出　　力</td>
      <td width="496">大きさＮ以上の１次元配列。ピボッティングの情報と２×２対角ブロックの行列式が出力される。</td>
    </tr>
    <tr valign="top">
      <td width="64">ＥＰＳ</td>
      <td width="80" align="center">実　数　型</td>
      <td width="64" align="center">入　　力</td>
      <td width="496">分解の途中でピボット要素の大きさが
<math xmlns="http://www.w3.org/1998/Math/MathML">‖A‖・EPS</math>
よりも小さくなったとき、係数行列が特異であると判定して計算を中断する。
<math xmlns="http://www.w3.org/1998/Math/MathML">EPS≦0.0</math>
を与えると標準値ｕが用いられる。ただし、　
<math xmlns="http://www.w3.org/1998/Math/MathML">u=2<msup><mrow /><mrow><mstyle fontsize="6pt">-20</mstyle></mrow></msup></math>
（単精度）、　
<math xmlns="http://www.w3.org/1998/Math/MathML">u=2<msup><mrow /><mrow><mstyle fontsize="6pt">-52</mstyle></mrow></msup></math>
（倍精度）。</td>
    </tr>
    <tr valign="top">
      <td width="64">ＩＷ</td>
      <td width="80" align="center">整　数　型<br />
      １次元配列</td>
      <td width="64" align="center">作業領域</td>
      <td width="496">大きさＮ以上の１次元配列。</td>
    </tr>
    <tr valign="top">
      <td width="64">ＩＮＤ</td>
      <td width="80" align="center">整　数　型</td>
      <td width="64" align="center">入出力</td>
      <td width="496">
      <dl>
        <dt>入力引数としては次の意味を持つ。</dt>
        <dd></dd>
        <dl>
          <dt>
<math xmlns="http://www.w3.org/1998/Math/MathML">IND=0</math>
：</dt>
          <dd>新たにバンチの分解から始めて方程式を解く。</dd>
          <dt>
<math xmlns="http://www.w3.org/1998/Math/MathML">IND≠0</math>
：</dt>
          <dd>直前に計算した分解成分を再利用し、方程式の求解だけ行う。この場合ＡとＣＨＧの内容が保存されていなければならない。</dd>
        </dl>
        <dt>出力引数としては次の意味を持つ。</dt>
        <dd></dd>
        <dl>
          <dt>
<math xmlns="http://www.w3.org/1998/Math/MathML">IND=0</math>
：</dt>
          <dd>正常終了。</dd>
          <dt>
<math xmlns="http://www.w3.org/1998/Math/MathML">IND=K</math>
：</dt>
          <dd>分解のＫ段目で特異と判定されたか又は帯幅がＫＡを越えた。</dd>
          <dt>
<math xmlns="http://www.w3.org/1998/Math/MathML">IND=30000</math>
：</dt>
          <dd>入力引数が制限を犯した。</dd>
        </dl>
      </dl>
      </td>
    </tr>
  </tbody>
</table>
</center>
<dl>
  <dt>＊</dt>
  <dd>倍精度用のサブルーチンの場合は、実数型をすべて倍精度実数型とする。</dd>
</dl>
（３）計算法<br />
　係数行列Ａが対称正値の場合は、単位上三角行列Ｕと対角行列Ｄとによって、改訂コレスキー分解

<math xmlns="http://www.w3.org/1998/Math/MathML">A=LD<msup><mrow>L</mrow><mrow>T</mrow></msup> </math>
が可能であるが、Ａが対称であっても正値でない場合には、この分解は一般に不可能である。しかしＤを、２×２の小行列をも対角ブロック要素として許すブロック対角行列とすれば、上の分解は可能である。バンチは、適当に行と列を交換して、分解
<math xmlns="http://www.w3.org/1998/Math/MathML">
A=LD<msup><mrow>L</mrow><mrow>T</mrow></msup></math>
 を、数値的に安定に行う算法を考案した。 <sup>1），2）</sup> 　本ルーチンは、バンチの算法Ａに基づいている。<br />
　この分解を用いれば 
<math xmlns="http://www.w3.org/1998/Math/MathML">AX=B</math>
 の解
<math xmlns="http://www.w3.org/1998/Math/MathML"> X=A<msup><mrow /><mrow><mstyle fontsize="6pt">-1</mstyle></mrow></msup>B</math>
 は、前進代入
<math xmlns="http://www.w3.org/1998/Math/MathML"> Y=L<msup><mrow /><mrow><mstyle fontsize="6pt">-1</mstyle></mrow></msup>B</math>
 と後退代入 
<math xmlns="http://www.w3.org/1998/Math/MathML">X=L<msup><mrow /><mrow><mstyle fontsize="6pt">-T</mstyle></mrow></msup>D<msup><mrow /><mrow><mstyle fontsize="6pt">-1</mstyle></mrow></msup>Y</math>
 によって求められる。<br />
<br />
<a href="/numpac/odm/testp/t012.html">（４）使用例</a><br />
<br />
（５）備　考<br />
<ul>
  <li> 1. ＥＰＳの標準的な値は、ＢＵＮＣＢＳ（Ｄ）の場合 
<math xmlns="http://www.w3.org/1998/Math/MathML">10<msup><mrow /><mrow><mstyle fontsize="6pt">-6</mstyle></mrow></msup>(10<msup><mrow /><mrow><mstyle fontsize="6pt">-16</mstyle></mrow></msup>)</math>
 である。
<math xmlns="http://www.w3.org/1998/Math/MathML">EPS≦:0</math>
を与えれば標準値 
<math xmlns="http://www.w3.org/1998/Math/MathML">2<msup><mrow /><mrow><mstyle fontsize="6pt">-20</mstyle></mrow></msup>(2<msup><mrow /><mrow><mstyle fontsize="6pt">-52</mstyle></mrow></msup>)</math>
 が用いられる。
  </li><li> 2. ＩＮＤは入出力引数であるから、実引数として定数を用いてはいけない。
  </li><li> 3. 同じ係数行列に対して、右辺列のみを変えて反復的に求解を行う場合には、本ルーチンの持つ分解成分の再利用の機能が極めて有用である。逆行列による方法に比べて、精度、速度及び記憶容量のいずれの点においても優れている。
  </li><li> 4. 右辺列の数Ｍが１のときは、Ｘに相当する実引数は１次元配列でもよい。ただし、
<math xmlns="http://www.w3.org/1998/Math/MathML">KX≧N</math>
の条件は成り立つようにしておく必要がある。
</li></ul>
<br />
<br />
参考文献<br />
<br />
1)J.R.Bunch et al.;&quot;Decomposition of a Symmetric Matrix&quot;Numer.Math.,Bd.27,pp.95-109(1976).<br />
2)J.R.Bunch et al.;&quot;Some Stable Methods for　Calculating Inertia and
Solving Symmetric　Linear Systems&quot;,Math. Comp.,Vol.31,137,pp.163-179(1977).<br />
<br />
<p align="right">(1987.06.16)<br />
</p>
<br />
<br />
</body>
</html>