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