計算ルーチン: ZGEQLFの QL 分解の結果より : (直交 Q の一部または全てを取り出す)

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

ホーム > LAPACKサンプルプログラム目次 > 計算ルーチン > ZGEQLFの QL 分解の結果より

概要

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

入力データ

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

このデータをダウンロード
ZUNGQL Example Program Data

   6             4                                       :Values of M and N

 ( 0.96,-0.81) (-0.03, 0.96) (-0.91, 2.06) (-0.05, 0.41)
 (-0.98, 1.98) (-1.20, 0.19) (-0.66, 0.42) (-0.81, 0.56)
 ( 0.62,-0.46) ( 1.01, 0.02) ( 0.63,-0.17) (-1.11, 0.60)
 (-0.37, 0.38) ( 0.19,-0.54) (-0.98,-0.36) ( 0.22,-0.20)
 ( 0.83, 0.51) ( 0.20, 0.01) (-0.17,-0.46) ( 1.47, 1.59)
 ( 1.08,-0.28) ( 0.20,-0.12) (-0.07, 1.23) ( 0.26, 0.26) :End of matrix A

出力結果

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

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

 The leading    4 columns of Q
                    1                 2                 3                 4
 1  ( 0.2810, 0.5020) (-0.2051,-0.1092) ( 0.3083,-0.6874) ( 0.0181,-0.1483)
 2  ( 0.2707,-0.3296) ( 0.5711, 0.0432) ( 0.2251,-0.1313) ( 0.2930,-0.2025)
 3  (-0.2864,-0.0094) (-0.5416, 0.0454) (-0.2062, 0.0691) ( 0.4015,-0.2170)
 4  ( 0.2262,-0.3854) (-0.3387, 0.2228) ( 0.3259, 0.1178) (-0.0796, 0.0723)
 5  ( 0.0341,-0.0760) ( 0.0098,-0.0712) ( 0.0753, 0.1412) (-0.5317,-0.5751)
 6  (-0.3936,-0.2083) (-0.1296, 0.3691) ( 0.0264,-0.4134) (-0.0940,-0.0940)

ソースコード

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

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


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

!     ZUNGQL 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: zgeqlf, zungql
      Use lapack_precision, Only: dp
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter :: nb = 64, nin = 5, nout = 6
!     .. Local Scalars ..
      Integer :: i, ifail, info, lda, lwork, m, n
      Character (30) :: title
!     .. Local Arrays ..
      Complex (Kind=dp), Allocatable :: a(:, :), tau(:), work(:)
      Character (1) :: clabs(1), rlabs(1)
!     .. Executable Statements ..
      Write (nout, *) 'ZUNGQL Example Program Results'
      Write (nout, *)
!     Skip heading in data file
      Read (nin, *)
      Read (nin, *) m, n
      lda = m
      lwork = nb*n
      Allocate (a(lda,n), tau(n), work(lwork))

!     Read A from data file

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

!     Compute the QL factorization of A
      Call zgeqlf(m, n, a, lda, tau, work, lwork, info)

!     Form the leading N columns of Q explicitly
      Call zungql(m, n, n, a, lda, tau, work, lwork, info)

!     Form the heading for nAGF_FILE_PRINT_MATRIX_COMPLEX_GEN_COMP

      Write (title, 100) n
      Flush (nout)

!     Print the leading N columns of Q

!     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', ' ', m, n, a, &
        lda, 'Bracketed', 'F7.4', title, 'Integer', rlabs, 'Integer', clabs, &
        80, 0, ifail)

100   Format ('The leading ', I4, ' columns of Q')
    End Program


ご案内
関連情報
Privacy Policy  /  Trademarks