137
138
139
140
141
142
143 LOGICAL TSTERR
144 INTEGER NM, NN, NOUT
145 REAL THRESH
146
147
148 LOGICAL DOTYPE( * )
149 INTEGER MVAL( * ), NVAL( * )
150 REAL S( * ), RWORK( * )
151 COMPLEX A( * ), COPYA( * ), TAU( * ), WORK( * )
152
153
154
155
156
157 INTEGER NTYPES
158 parameter( ntypes = 3 )
159 INTEGER NTESTS
160 parameter( ntests = 3 )
161 REAL ONE, ZERO
162 parameter( one = 1.0e0, zero = 0.0e0 )
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 REAL EPS
169
170
171 INTEGER ISEED( 4 ), ISEEDY( 4 )
172 REAL RESULT( NTESTS )
173
174
175 REAL CQRT12, CRZT01, CRZT02, SLAMCH
177
178
181
182
183 INTRINSIC cmplx, 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 ) = 'Complex 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 cerrtz( 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 claset(
'Full', m, n, cmplx( zero ),
251 $ cmplx( zero ), a, lda )
252 DO 30 i = 1, mnmin
253 s( i ) = zero
254 30 CONTINUE
255 ELSE
256 CALL clatms( m, n,
'Uniform', iseed,
257 $ 'Nonsymmetric', s, imode,
258 $ one / eps, one, m, n, 'No packing', a,
259 $ lda, work, info )
260 CALL cgeqr2( m, n, a, lda, work, work( mnmin+1 ),
261 $ info )
262 CALL claset(
'Lower', m-1, n, cmplx( zero ),
263 $ cmplx( zero ), a( 2 ), lda )
264 CALL slaord(
'Decreasing', mnmin, s, 1 )
265 END IF
266
267
268
269 CALL clacpy(
'All', m, n, a, lda, copya, lda )
270
271
272
273
274 srnamt = 'CTZRZF'
275 CALL ctzrzf( m, n, a, lda, tau, work, lwork, info )
276
277
278
279 result( 1 ) =
cqrt12( m, m, a, lda, s, work,
280 $ lwork, rwork )
281
282
283
284 result( 2 ) =
crzt01( m, n, copya, a, lda, tau, work,
285 $ lwork )
286
287
288
289 result( 3 ) =
crzt02( 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 cerrtz(path, nunit)
CERRTZ
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
real function cqrt12(m, n, a, lda, s, work, lwork, rwork)
CQRT12
real function crzt01(m, n, a, af, lda, tau, work, lwork)
CRZT01
real function crzt02(m, n, af, lda, tau, work, lwork)
CRZT02
subroutine cgeqr2(m, n, a, lda, tau, work, info)
CGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm.
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
real function slamch(cmach)
SLAMCH
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine ctzrzf(m, n, a, lda, tau, work, lwork, info)
CTZRZF
subroutine slaord(job, n, x, incx)
SLAORD