計算ルーチン: ユニタリ相似変換を用いた複素行列のシュール分解の並べ替え

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

ホーム > LAPACKサンプルプログラム目次 > 計算ルーチン > ユニタリ相似変換を用いた複素行列のシュール分解の並べ替え

概要

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

入力データ

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

このデータをダウンロード
ZTREXC Example Program Data
  4                                                        :Value of N
 (-6.00,-7.00) ( 0.36,-0.36) (-0.19, 0.48) ( 0.88,-0.25)
 ( 0.00, 0.00) (-5.00, 2.00) (-0.03,-0.72) (-0.23, 0.13)
 ( 0.00, 0.00) ( 0.00, 0.00) ( 8.00,-1.00) ( 0.94, 0.53)
 ( 0.00, 0.00) ( 0.00, 0.00) ( 0.00, 0.00) ( 3.00,-4.00)   :End of matrix T
  1  4                                             :Values of IFST and ILST

出力結果

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

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

 Reordered Schur form
                    1                 2                 3                 4
 1  (-5.0000, 2.0000) (-0.1574, 0.7143) ( 0.1781,-0.1913) ( 0.3950, 0.3861)
 2  ( 0.0000, 0.0000) ( 8.0000,-1.0000) ( 1.0742, 0.1447) ( 0.2515,-0.3397)
 3  ( 0.0000, 0.0000) ( 0.0000, 0.0000) ( 3.0000,-4.0000) ( 0.2264, 0.8962)
 4  ( 0.0000, 0.0000) ( 0.0000, 0.0000) ( 0.0000, 0.0000) (-6.0000,-7.0000)

ソースコード

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

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


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

!     ZTREXC Example Program Text

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

!     .. Use Statements ..
      Use lapack_example_aux, Only: nagf_file_print_matrix_complex_gen_comp
      Use lapack_interfaces, Only: ztrexc
      Use lapack_precision, Only: dp
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter :: nin = 5, nout = 6
!     .. Local Scalars ..
      Integer :: i, ifail, ifst, ilst, info, ldq, ldt, n
!     .. Local Arrays ..
      Complex (Kind=dp), Allocatable :: q(:, :), t(:, :)
      Character (1) :: clabs(1), rlabs(1)
!     .. Executable Statements ..
      Write (nout, *) 'ZTREXC Example Program Results'
      Write (nout, *)
      Flush (nout)
!     Skip heading in data file
      Read (nin, *)
      Read (nin, *) n
      ldq = 1
      ldt = n
      Allocate (q(ldq,1), t(ldt,n))

!     Read T from data file

      Read (nin, *)(t(i,1:n), i=1, n)

!     Read the row indices

      Read (nin, *) ifst, ilst

!     Reorder the Schur factor T

      Call ztrexc('No update', n, t, ldt, q, ldq, ifst, ilst, info)
      If (info/=0) Then
        Write (nout, 100) info, ilst
        Write (nout, *)
        Flush (nout)
      End If

!     Print reordered Schur form

!     ifail: behaviour on error exit
!             =0 for hard exit, =1 for quiet-soft, =-1 for noisy-soft
      ifail = 0
      Call nagf_file_print_matrix_complex_gen_comp('General', ' ', n, n, t, &
        ldt, 'Bracketed', 'F7.4', 'Reordered Schur form', 'Integer', rlabs, &
        'Integer', clabs, 80, 0, ifail)

100   Format (' Reordering could not be completed. INFO = ', I3, ' ILST = ', &
        I5)
    End Program


ご案内
関連情報
Privacy Policy  /  Trademarks