計算ルーチン: 実一般長方格子の準対角形への直交縮約

LAPACKサンプルソースコード : 使用ルーチン名:DGEBRD

ホーム > LAPACKサンプルプログラム目次 > 計算ルーチン > 実一般長方格子の準対角形への直交縮約

概要

本サンプルはFortran言語によりLAPACKルーチンDGEBRDを利用するサンプルプログラムです。

入力データ

(本ルーチンの詳細はDGEBRD のマニュアルページを参照)

このデータをダウンロード
DGEBRD Example Program Data
  6  4                        :Values of M and N
 -0.57  -1.28  -0.39   0.25
 -1.93   1.08  -0.31  -2.14
  2.30   0.24   0.40  -0.35
 -1.93   0.64  -0.66   0.08
  0.15   0.30   0.15  -2.13
 -0.02   1.03  -1.43   0.50   :End of matrix A

出力結果

(本ルーチンの詳細はDGEBRD のマニュアルページを参照)

この出力例をダウンロード
 DGEBRD Example Program Results

 Diagonal
    3.6177   2.4161  -1.9213  -1.4265
 Superdiagonal
    1.2587   1.5262  -1.1895

ソースコード

(本ルーチンの詳細はDGEBRD のマニュアルページを参照)

※本サンプルソースコードのご利用手順は「サンプルのコンパイル及び実行方法」をご参照下さい。


このソースコードをダウンロード
    Program dgebrd_example

!     DGEBRD Example Program Text

!     Copyright 2017, Numerical Algorithms Group Ltd. http://www.nag.com

!     .. Use Statements ..
      Use lapack_interfaces, Only: dgebrd
      Use lapack_precision, Only: dp
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter :: nin = 5, nout = 6
!     .. Local Scalars ..
      Integer :: i, info, lda, lwork, m, n
!     .. Local Arrays ..
      Real (Kind=dp), Allocatable :: a(:, :), d(:), e(:), taup(:), tauq(:), &
        work(:)
!     .. Intrinsic Procedures ..
      Intrinsic :: min
!     .. Executable Statements ..
      Write (nout, *) 'DGEBRD Example Program Results'
!     Skip heading in data file
      Read (nin, *)
      Read (nin, *) m, n
      lda = m
      lwork = 64*(m+n)
      Allocate (a(lda,n), d(n), e(n-1), taup(n), tauq(n), work(lwork))

!     Read A from data file

      Read (nin, *)(a(i,1:n), i=1, m)

!     Reduce A to bidiagonal form

      Call dgebrd(m, n, a, lda, d, e, tauq, taup, work, lwork, info)

!     Print bidiagonal form

      Write (nout, *)
      Write (nout, *) 'Diagonal'
      Write (nout, 100) d(1:min(m,n))
      If (m>=n) Then
        Write (nout, *) 'Superdiagonal'
      Else
        Write (nout, *) 'Subdiagonal'
      End If
      Write (nout, 100) e(1:min(m,n)-1)

100   Format (1X, 8F9.4)
    End Program


ご案内
関連情報
Privacy Policy  /  Trademarks