137
138
139
140
141
142
143 LOGICAL TSTERR
144 INTEGER NM, NN, NOUT
145 DOUBLE PRECISION THRESH
146
147
148 LOGICAL DOTYPE( * )
149 INTEGER MVAL( * ), NVAL( * )
150 DOUBLE PRECISION S( * ), RWORK( * )
151 COMPLEX*16 A( * ), COPYA( * ), TAU( * ), WORK( * )
152
153
154
155
156
157 INTEGER NTYPES
158 parameter( ntypes = 3 )
159 INTEGER NTESTS
160 parameter( ntests = 3 )
161 DOUBLE PRECISION ONE, ZERO
162 parameter( one = 1.0d0, zero = 0.0d0 )
163
164
165 CHARACTER*3 PATH
166 INTEGER I, IM, IMODE, IN, INFO, K, LDA, LWORK, M,
167 $ MNMIN, MODE, N, NERRS, NFAIL, NRUN
168 DOUBLE PRECISION EPS
169
170
171 INTEGER ISEED( 4 ), ISEEDY( 4 )
172 DOUBLE PRECISION RESULT( NTESTS )
173
174
175 DOUBLE PRECISION DLAMCH, ZQRT12, ZRZT01, ZRZT02
177
178
181
182
183 INTRINSIC dcmplx, max, min
184
185
186 LOGICAL LERR, OK
187 CHARACTER*32 SRNAMT
188 INTEGER INFOT, IOUNIT
189
190
191 COMMON / infoc / infot, iounit, ok, lerr
192 COMMON / srnamc / srnamt
193
194
195 DATA iseedy / 1988, 1989, 1990, 1991 /
196
197
198
199
200
201 path( 1: 1 ) = 'Zomplex precision'
202 path( 2: 3 ) = 'TZ'
203 nrun = 0
204 nfail = 0
205 nerrs = 0
206 DO 10 i = 1, 4
207 iseed( i ) = iseedy( i )
208 10 CONTINUE
210
211
212
213 IF( tsterr )
214 $
CALL zerrtz( path, nout )
215 infot = 0
216
217 DO 70 im = 1, nm
218
219
220
221 m = mval( im )
222 lda = max( 1, m )
223
224 DO 60 in = 1, nn
225
226
227
228 n = nval( in )
229 mnmin = min( m, n )
230 lwork = max( 1, n*n+4*m+n )
231
232 IF( m.LE.n ) THEN
233 DO 50 imode = 1, ntypes
234 IF( .NOT.dotype( imode ) )
235 $ GO TO 50
236
237
238
239
240
241
242 mode = imode - 1
243
244
245
246
247
248
249 IF( mode.EQ.0 ) THEN
250 CALL zlaset(
'Full', m, n, dcmplx( zero ),
251 $ dcmplx( zero ), a, lda )
252 DO 30 i = 1, mnmin
253 s( i ) = zero
254 30 CONTINUE
255 ELSE
256 CALL zlatms( m, n,
'Uniform', iseed,
257 $ 'Nonsymmetric', s, imode,
258 $ one / eps, one, m, n, 'No packing', a,
259 $ lda, work, info )
260 CALL zgeqr2( m, n, a, lda, work, work( mnmin+1 ),
261 $ info )
262 CALL zlaset(
'Lower', m-1, n, dcmplx( zero ),
263 $ dcmplx( zero ), a( 2 ), lda )
264 CALL dlaord(
'Decreasing', mnmin, s, 1 )
265 END IF
266
267
268
269 CALL zlacpy(
'All', m, n, a, lda, copya, lda )
270
271
272
273
274 srnamt = 'ZTZRZF'
275 CALL ztzrzf( m, n, a, lda, tau, work, lwork, info )
276
277
278
279 result( 1 ) =
zqrt12( m, m, a, lda, s, work,
280 $ lwork, rwork )
281
282
283
284 result( 2 ) =
zrzt01( m, n, copya, a, lda, tau, work,
285 $ lwork )
286
287
288
289 result( 3 ) =
zrzt02( m, n, a, lda, tau, work, lwork )
290
291
292
293
294 DO 40 k = 1, ntests
295 IF( result( k ).GE.thresh ) THEN
296 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
297 $
CALL alahd( nout, path )
298 WRITE( nout, fmt = 9999 )m, n, imode, k,
299 $ result( k )
300 nfail = nfail + 1
301 END IF
302 40 CONTINUE
303 nrun = nrun + 3
304 50 CONTINUE
305 END IF
306 60 CONTINUE
307 70 CONTINUE
308
309
310
311 CALL alasum( path, nout, nfail, nrun, nerrs )
312
313 9999 FORMAT( ' M =', i5, ', N =', i5, ', type ', i2, ', test ', i2,
314 $ ', ratio =', g12.5 )
315
316
317
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
subroutine alahd(iounit, path)
ALAHD
subroutine dlaord(job, n, x, incx)
DLAORD
subroutine zgeqr2(m, n, a, lda, tau, work, info)
ZGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm.
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
double precision function dlamch(cmach)
DLAMCH
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.
subroutine ztzrzf(m, n, a, lda, tau, work, lwork, info)
ZTZRZF
subroutine zerrtz(path, nunit)
ZERRTZ
subroutine zlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
ZLATMS
double precision function zqrt12(m, n, a, lda, s, work, lwork, rwork)
ZQRT12
double precision function zrzt01(m, n, a, af, lda, tau, work, lwork)
ZRZT01
double precision function zrzt02(m, n, af, lda, tau, work, lwork)
ZRZT02