LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zlqt05()

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

ZLQT05

Purpose:
 ZQRT05 tests ZTPLQT and ZTPMLQT.
Parameters
[in]M
          M is INTEGER
          Number of rows in lower part of the test matrix.
[in]N
          N is INTEGER
          Number of columns in test matrix.
[in]L
          L is INTEGER
          The number of rows of the upper trapezoidal part the
          lower test matrix.  0 <= L <= M.
[in]NB
          NB is INTEGER
          Block size of test matrix.  NB <= N.
[out]RESULT
          RESULT is DOUBLE PRECISION array, dimension (6)
          Results of each of the six tests below.

          RESULT(1) = | A - Q R |
          RESULT(2) = | I - Q^H Q |
          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 82 of file zlqt05.f.

82  IMPLICIT NONE
83 *
84 * -- LAPACK test routine (version 3.7.0) --
85 * -- LAPACK is a software package provided by Univ. of Tennessee, --
86 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
87 * April 2012
88 *
89 * .. Scalar Arguments ..
90  INTEGER lwork, m, n, l, nb, ldt
91 * .. Return values ..
92  DOUBLE PRECISION result(6)
93 *
94 * =====================================================================
95 *
96 * ..
97 * .. Local allocatable arrays
98  COMPLEX*16, ALLOCATABLE :: af(:,:), q(:,:),
99  $ r(:,:), rwork(:), work( : ), t(:,:),
100  $ cf(:,:), df(:,:), a(:,:), c(:,:), d(:,:)
101 *
102 * .. Parameters ..
103  DOUBLE PRECISION zero
104  COMPLEX*16 one, czero
105  parameter( zero = 0.0, one = (1.0,0.0), czero=(0.0,0.0) )
106 * ..
107 * .. Local Scalars ..
108  INTEGER info, j, k, n2, np1,i
109  DOUBLE PRECISION anorm, eps, resid, cnorm, dnorm
110 * ..
111 * .. Local Arrays ..
112  INTEGER iseed( 4 )
113 * ..
114 * .. External Functions ..
115  DOUBLE PRECISION dlamch
116  DOUBLE PRECISION zlange, zlansy
117  LOGICAL lsame
118  EXTERNAL dlamch, zlange, zlansy, lsame
119 * ..
120 * .. Data statements ..
121  DATA iseed / 1988, 1989, 1990, 1991 /
122 *
123  eps = dlamch( 'Epsilon' )
124  k = m
125  n2 = m+n
126  IF( n.GT.0 ) THEN
127  np1 = m+1
128  ELSE
129  np1 = 1
130  END IF
131  lwork = n2*n2*nb
132 *
133 * Dynamically allocate all arrays
134 *
135  ALLOCATE(a(m,n2),af(m,n2),q(n2,n2),r(n2,n2),rwork(n2),
136  $ work(lwork),t(nb,m),c(n2,m),cf(n2,m),
137  $ d(m,n2),df(m,n2) )
138 *
139 * Put random stuff into A
140 *
141  ldt=nb
142  CALL zlaset( 'Full', m, n2, czero, czero, a, m )
143  CALL zlaset( 'Full', nb, m, czero, czero, t, nb )
144  DO j=1,m
145  CALL zlarnv( 2, iseed, m-j+1, a( j, j ) )
146  END DO
147  IF( n.GT.0 ) THEN
148  DO j=1,n-l
149  CALL zlarnv( 2, iseed, m, a( 1, min(n+m,m+1) + j - 1 ) )
150  END DO
151  END IF
152  IF( l.GT.0 ) THEN
153  DO j=1,l
154  CALL zlarnv( 2, iseed, m-j+1, a( j, min(n+m,n+m-l+1)
155  $ + j - 1 ) )
156  END DO
157  END IF
158 *
159 * Copy the matrix A to the array AF.
160 *
161  CALL zlacpy( 'Full', m, n2, a, m, af, m )
162 *
163 * Factor the matrix A in the array AF.
164 *
165  CALL ztplqt( m,n,l,nb,af,m,af(1,np1),m,t,ldt,work,info)
166 *
167 * Generate the (M+N)-by-(M+N) matrix Q by applying H to I
168 *
169  CALL zlaset( 'Full', n2, n2, czero, one, q, n2 )
170  CALL zgemlqt( 'L', 'N', n2, n2, k, nb, af, m, t, ldt, q, n2,
171  $ work, info )
172 *
173 * Copy L
174 *
175  CALL zlaset( 'Full', n2, n2, czero, czero, r, n2 )
176  CALL zlacpy( 'Lower', m, n2, af, m, r, n2 )
177 *
178 * Compute |L - A*Q*C| / |A| and store in RESULT(1)
179 *
180  CALL zgemm( 'N', 'C', m, n2, n2, -one, a, m, q, n2, one, r, n2)
181  anorm = zlange( '1', m, n2, a, m, rwork )
182  resid = zlange( '1', m, n2, r, n2, rwork )
183  IF( anorm.GT.zero ) THEN
184  result( 1 ) = resid / (eps*anorm*max(1,n2))
185  ELSE
186  result( 1 ) = zero
187  END IF
188 *
189 * Compute |I - Q*Q'| and store in RESULT(2)
190 *
191  CALL zlaset( 'Full', n2, n2, czero, one, r, n2 )
192  CALL zherk( 'U', 'N', n2, n2, dreal(-one), q, n2, dreal(one),
193  $ r, n2 )
194  resid = zlansy( '1', 'Upper', n2, r, n2, rwork )
195  result( 2 ) = resid / (eps*max(1,n2))
196 *
197 * Generate random m-by-n matrix C and a copy CF
198 *
199  CALL zlaset( 'Full', n2, m, czero, one, c, n2 )
200  DO j=1,m
201  CALL zlarnv( 2, iseed, n2, c( 1, j ) )
202  END DO
203  cnorm = zlange( '1', n2, m, c, n2, rwork)
204  CALL zlacpy( 'Full', n2, m, c, n2, cf, n2 )
205 *
206 * Apply Q to C as Q*C
207 *
208  CALL ztpmlqt( 'L','N', n,m,k,l,nb,af(1, np1),m,t,ldt,cf,n2,
209  $ cf(np1,1),n2,work,info)
210 *
211 * Compute |Q*C - Q*C| / |C|
212 *
213  CALL zgemm( 'N', 'N', n2, m, n2, -one, q, n2, c, n2, one, cf, n2 )
214  resid = zlange( '1', n2, m, cf, n2, rwork )
215  IF( cnorm.GT.zero ) THEN
216  result( 3 ) = resid / (eps*max(1,n2)*cnorm)
217  ELSE
218  result( 3 ) = zero
219  END IF
220 
221 *
222 * Copy C into CF again
223 *
224  CALL zlacpy( 'Full', n2, m, c, n2, cf, n2 )
225 *
226 * Apply Q to C as QT*C
227 *
228  CALL ztpmlqt( 'L','C',n,m,k,l,nb,af(1,np1),m,t,ldt,cf,n2,
229  $ cf(np1,1),n2,work,info)
230 *
231 * Compute |QT*C - QT*C| / |C|
232 *
233  CALL zgemm('C','N',n2,m,n2,-one,q,n2,c,n2,one,cf,n2)
234  resid = zlange( '1', n2, m, cf, n2, rwork )
235 
236  IF( cnorm.GT.zero ) THEN
237  result( 4 ) = resid / (eps*max(1,n2)*cnorm)
238  ELSE
239  result( 4 ) = zero
240  END IF
241 *
242 * Generate random m-by-n matrix D and a copy DF
243 *
244  DO j=1,n2
245  CALL zlarnv( 2, iseed, m, d( 1, j ) )
246  END DO
247  dnorm = zlange( '1', m, n2, d, m, rwork)
248  CALL zlacpy( 'Full', m, n2, d, m, df, m )
249 *
250 * Apply Q to D as D*Q
251 *
252  CALL ztpmlqt('R','N',m,n,k,l,nb,af(1,np1),m,t,ldt,df,m,
253  $ df(1,np1),m,work,info)
254 *
255 * Compute |D*Q - D*Q| / |D|
256 *
257  CALL zgemm('N','N',m,n2,n2,-one,d,m,q,n2,one,df,m)
258  resid = zlange('1',m, n2,df,m,rwork )
259  IF( cnorm.GT.zero ) THEN
260  result( 5 ) = resid / (eps*max(1,n2)*dnorm)
261  ELSE
262  result( 5 ) = zero
263  END IF
264 *
265 * Copy D into DF again
266 *
267  CALL zlacpy('Full',m,n2,d,m,df,m )
268 *
269 * Apply Q to D as D*QT
270 *
271  CALL ztpmlqt('R','C',m,n,k,l,nb,af(1,np1),m,t,ldt,df,m,
272  $ df(1,np1),m,work,info)
273 
274 *
275 * Compute |D*QT - D*QT| / |D|
276 *
277  CALL zgemm( 'N', 'C', m, n2, n2, -one, d, m, q, n2, one, df, m )
278  resid = zlange( '1', m, n2, df, m, rwork )
279  IF( cnorm.GT.zero ) THEN
280  result( 6 ) = resid / (eps*max(1,n2)*dnorm)
281  ELSE
282  result( 6 ) = zero
283  END IF
284 *
285 * Deallocate all arrays
286 *
287  DEALLOCATE ( a, af, q, r, rwork, work, t, c, d, cf, df)
288  RETURN
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine ztpmlqt(SIDE, TRANS, M, N, K, L, MB, V, LDV, T, LDT, A, LDA, B, LDB, WORK, INFO)
ZTPMLQT
Definition: ztpmlqt.f:218
subroutine ztplqt(M, N, L, MB, A, LDA, B, LDB, T, LDT, WORK, INFO)
ZTPLQT
Definition: ztplqt.f:191
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: