LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zlqt04()

subroutine zlqt04 ( integer  M,
integer  N,
integer  NB,
double precision, dimension(6)  RESULT 
)

DLQT04

Purpose:
 ZLQT04 tests ZGELQT and ZUNMLQT.
Parameters
[in]M
          M is INTEGER
          Number of rows in test matrix.
[in]N
          N is INTEGER
          Number of columns in test matrix.
[in]NB
          NB is INTEGER
          Block size of test matrix.  NB <= Min(M,N).
[out]RESULT
          RESULT is DOUBLE PRECISION array, dimension (6)
          Results of each of the six tests below.

          RESULT(1) = | A - L Q |
          RESULT(2) = | I - Q Q^H |
          RESULT(3) = | Q C - Q C |
          RESULT(4) = | Q^H C - Q^H C |
          RESULT(5) = | C Q - C Q |
          RESULT(6) = | C Q^H - C Q^H |
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
April 2012

Definition at line 75 of file zlqt04.f.

75  IMPLICIT NONE
76 *
77 * -- LAPACK test routine (version 3.7.0) --
78 * -- LAPACK is a software package provided by Univ. of Tennessee, --
79 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
80 * April 2012
81 *
82 * .. Scalar Arguments ..
83  INTEGER m, n, nb
84 * .. Return values ..
85  DOUBLE PRECISION result(6)
86 *
87 * =====================================================================
88 *
89 * ..
90 * .. Local allocatable arrays
91  COMPLEX*16, ALLOCATABLE :: af(:,:), q(:,:),
92  $ l(:,:), rwork(:), work( : ), t(:,:),
93  $ cf(:,:), df(:,:), a(:,:), c(:,:), d(:,:)
94 *
95 * .. Parameters ..
96  DOUBLE PRECISION zero
97  COMPLEX*16 one, czero
98  parameter( zero = 0.0)
99  parameter( one = (1.0,0.0), czero=(0.0,0.0) )
100 * ..
101 * .. Local Scalars ..
102  INTEGER info, j, k, ll, lwork, ldt
103  DOUBLE PRECISION anorm, eps, resid, cnorm, dnorm
104 * ..
105 * .. Local Arrays ..
106  INTEGER iseed( 4 )
107 * ..
108 * .. External Functions ..
109  DOUBLE PRECISION dlamch
110  DOUBLE PRECISION zlange, zlansy
111  LOGICAL lsame
112  EXTERNAL dlamch, zlange, zlansy, lsame
113 * ..
114 * .. Intrinsic Functions ..
115  INTRINSIC max, min
116 * ..
117 * .. Data statements ..
118  DATA iseed / 1988, 1989, 1990, 1991 /
119 *
120  eps = dlamch( 'Epsilon' )
121  k = min(m,n)
122  ll = max(m,n)
123  lwork = max(2,ll)*max(2,ll)*nb
124 *
125 * Dynamically allocate local arrays
126 *
127  ALLOCATE ( a(m,n), af(m,n), q(n,n), l(ll,n), rwork(ll),
128  $ work(lwork), t(nb,n), c(m,n), cf(m,n),
129  $ d(n,m), df(n,m) )
130 *
131 * Put random numbers into A and copy to AF
132 *
133  ldt=nb
134  DO j=1,n
135  CALL zlarnv( 2, iseed, m, a( 1, j ) )
136  END DO
137  CALL zlacpy( 'Full', m, n, a, m, af, m )
138 *
139 * Factor the matrix A in the array AF.
140 *
141  CALL zgelqt( m, n, nb, af, m, t, ldt, work, info )
142 *
143 * Generate the n-by-n matrix Q
144 *
145  CALL zlaset( 'Full', n, n, czero, one, q, n )
146  CALL zgemlqt( 'R', 'N', n, n, k, nb, af, m, t, ldt, q, n,
147  $ work, info )
148 *
149 * Copy L
150 *
151  CALL zlaset( 'Full', ll, n, czero, czero, l, ll )
152  CALL zlacpy( 'Lower', m, n, af, m, l, ll )
153 *
154 * Compute |L - A*Q'| / |A| and store in RESULT(1)
155 *
156  CALL zgemm( 'N', 'C', m, n, n, -one, a, m, q, n, one, l, ll )
157  anorm = zlange( '1', m, n, a, m, rwork )
158  resid = zlange( '1', m, n, l, ll, rwork )
159  IF( anorm.GT.zero ) THEN
160  result( 1 ) = resid / (eps*max(1,m)*anorm)
161  ELSE
162  result( 1 ) = zero
163  END IF
164 *
165 * Compute |I - Q'*Q| and store in RESULT(2)
166 *
167  CALL zlaset( 'Full', n, n, czero, one, l, ll )
168  CALL zherk( 'U', 'C', n, n, dreal(-one), q, n, dreal(one), l, ll)
169  resid = zlansy( '1', 'Upper', n, l, ll, rwork )
170  result( 2 ) = resid / (eps*max(1,n))
171 *
172 * Generate random m-by-n matrix C and a copy CF
173 *
174  DO j=1,m
175  CALL zlarnv( 2, iseed, n, d( 1, j ) )
176  END DO
177  dnorm = zlange( '1', n, m, d, n, rwork)
178  CALL zlacpy( 'Full', n, m, d, n, df, n )
179 *
180 * Apply Q to C as Q*C
181 *
182  CALL zgemlqt( 'L', 'N', n, m, k, nb, af, m, t, nb, df, n,
183  $ work, info)
184 *
185 * Compute |Q*D - Q*D| / |D|
186 *
187  CALL zgemm( 'N', 'N', n, m, n, -one, q, n, d, n, one, df, n )
188  resid = zlange( '1', n, m, df, n, rwork )
189  IF( dnorm.GT.zero ) THEN
190  result( 3 ) = resid / (eps*max(1,m)*dnorm)
191  ELSE
192  result( 3 ) = zero
193  END IF
194 *
195 * Copy D into DF again
196 *
197  CALL zlacpy( 'Full', n, m, d, n, df, n )
198 *
199 * Apply Q to D as QT*D
200 *
201  CALL zgemlqt( 'L', 'C', n, m, k, nb, af, m, t, nb, df, n,
202  $ work, info)
203 *
204 * Compute |QT*D - QT*D| / |D|
205 *
206  CALL zgemm( 'C', 'N', n, m, n, -one, q, n, d, n, one, df, n )
207  resid = zlange( '1', n, m, df, n, rwork )
208  IF( dnorm.GT.zero ) THEN
209  result( 4 ) = resid / (eps*max(1,m)*dnorm)
210  ELSE
211  result( 4 ) = zero
212  END IF
213 *
214 * Generate random n-by-m matrix D and a copy DF
215 *
216  DO j=1,n
217  CALL zlarnv( 2, iseed, m, c( 1, j ) )
218  END DO
219  cnorm = zlange( '1', m, n, c, m, rwork)
220  CALL zlacpy( 'Full', m, n, c, m, cf, m )
221 *
222 * Apply Q to C as C*Q
223 *
224  CALL zgemlqt( 'R', 'N', m, n, k, nb, af, m, t, nb, cf, m,
225  $ work, info)
226 *
227 * Compute |C*Q - C*Q| / |C|
228 *
229  CALL zgemm( 'N', 'N', m, n, n, -one, c, m, q, n, one, cf, m )
230  resid = zlange( '1', n, m, df, n, rwork )
231  IF( cnorm.GT.zero ) THEN
232  result( 5 ) = resid / (eps*max(1,m)*dnorm)
233  ELSE
234  result( 5 ) = zero
235  END IF
236 *
237 * Copy C into CF again
238 *
239  CALL zlacpy( 'Full', m, n, c, m, cf, m )
240 *
241 * Apply Q to D as D*QT
242 *
243  CALL zgemlqt( 'R', 'C', m, n, k, nb, af, m, t, nb, cf, m,
244  $ work, info)
245 *
246 * Compute |C*QT - C*QT| / |C|
247 *
248  CALL zgemm( 'N', 'C', m, n, n, -one, c, m, q, n, one, cf, m )
249  resid = zlange( '1', m, n, cf, m, rwork )
250  IF( cnorm.GT.zero ) THEN
251  result( 6 ) = resid / (eps*max(1,m)*dnorm)
252  ELSE
253  result( 6 ) = zero
254  END IF
255 *
256 * Deallocate all arrays
257 *
258  DEALLOCATE ( a, af, q, l, rwork, work, t, c, d, cf, df)
259 *
260  RETURN
subroutine zgelqt(M, N, MB, A, LDA, T, LDT, WORK, INFO)
ZGELQT
Definition: zgelqt.f:141
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zgemlqt(SIDE, TRANS, M, N, K, MB, V, LDV, T, LDT, C, LDC, WORK, INFO)
ZGEMLQT
Definition: zgemlqt.f:170
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
Definition: zlacpy.f:105
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
Definition: zgemm.f:189
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlange.f:117
double precision function zlansy(NORM, UPLO, N, A, LDA, WORK)
ZLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex symmetric matrix.
Definition: zlansy.f:125
subroutine zlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: zlaset.f:108
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine zherk(UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC)
ZHERK
Definition: zherk.f:175
subroutine zlarnv(IDIST, ISEED, N, X)
ZLARNV returns a vector of random numbers from a uniform or normal distribution.
Definition: zlarnv.f:101
Here is the call graph for this function:
Here is the caller graph for this function: