3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE SCHKLQ( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NXVAL,
12 * NRHS, THRESH, TSTERR, NMAX, A, AF, AQ, AL, AC,
13 * B, X, XACT, TAU, WORK, RWORK, NOUT )
15 * .. Scalar Arguments ..
17 * INTEGER NM, NMAX, NN, NNB, NOUT, NRHS
20 * .. Array Arguments ..
22 * INTEGER MVAL( * ), NBVAL( * ), NVAL( * ),
24 * REAL A( * ), AC( * ), AF( * ), AL( * ), AQ( * ),
25 * $ B( * ), RWORK( * ), TAU( * ), WORK( * ),
35 *> SCHKLQ tests SGELQF, SORGLQ and SORMLQ.
43 *> DOTYPE is LOGICAL array, dimension (NTYPES)
44 *> The matrix types to be used for testing. Matrices of type j
45 *> (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) =
46 *> .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used.
52 *> The number of values of M contained in the vector MVAL.
57 *> MVAL is INTEGER array, dimension (NM)
58 *> The values of the matrix row dimension M.
64 *> The number of values of N contained in the vector NVAL.
69 *> NVAL is INTEGER array, dimension (NN)
70 *> The values of the matrix column dimension N.
76 *> The number of values of NB and NX contained in the
77 *> vectors NBVAL and NXVAL. The blocking parameters are used
83 *> NBVAL is INTEGER array, dimension (NNB)
84 *> The values of the blocksize NB.
89 *> NXVAL is INTEGER array, dimension (NNB)
90 *> The values of the crossover point NX.
96 *> The number of right hand side vectors to be generated for
97 *> each linear system.
103 *> The threshold value for the test ratios. A result is
104 *> included in the output file if RESULT >= THRESH. To have
105 *> every test ratio printed, use THRESH = 0.
111 *> Flag that indicates whether error exits are to be tested.
117 *> The maximum value permitted for M or N, used in dimensioning
123 *> A is REAL array, dimension (NMAX*NMAX)
128 *> AF is REAL array, dimension (NMAX*NMAX)
133 *> AQ is REAL array, dimension (NMAX*NMAX)
138 *> AL is REAL array, dimension (NMAX*NMAX)
143 *> AC is REAL array, dimension (NMAX*NMAX)
148 *> B is REAL array, dimension (NMAX*NRHS)
153 *> X is REAL array, dimension (NMAX*NRHS)
158 *> XACT is REAL array, dimension (NMAX*NRHS)
163 *> TAU is REAL array, dimension (NMAX)
168 *> WORK is REAL array, dimension (NMAX*NMAX)
173 *> RWORK is REAL array, dimension (NMAX)
179 *> The unit number for output.
185 *> \author Univ. of Tennessee
186 *> \author Univ. of California Berkeley
187 *> \author Univ. of Colorado Denver
190 *> \date November 2015
192 *> \ingroup single_lin
194 * =====================================================================
195 SUBROUTINE SCHKLQ( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NXVAL,
196 $ NRHS, THRESH, TSTERR, NMAX, A, AF, AQ, AL, AC,
197 $ B, X, XACT, TAU, WORK, RWORK, NOUT )
199 * -- LAPACK test routine (version 3.6.0) --
200 * -- LAPACK is a software package provided by Univ. of Tennessee, --
201 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
204 * .. Scalar Arguments ..
206 INTEGER NM, NMAX, NN, NNB, NOUT, NRHS
209 * .. Array Arguments ..
211 INTEGER MVAL( * ), NBVAL( * ), NVAL( * ),
213 REAL A( * ), AC( * ), AF( * ), AL( * ), AQ( * ),
214 $ B( * ), RWORK( * ), TAU( * ), WORK( * ),
218 * =====================================================================
222 PARAMETER ( NTESTS = 7 )
224 PARAMETER ( NTYPES = 8 )
226 PARAMETER ( ZERO = 0.0E0 )
228 * .. Local Scalars ..
231 INTEGER I, IK, IM, IMAT, IN, INB, INFO, K, KL, KU, LDA,
232 $ LWORK, M, MINMN, MODE, N, NB, NERRS, NFAIL, NK,
237 INTEGER ISEED( 4 ), ISEEDY( 4 ), KVAL( 4 )
238 REAL RESULT( NTESTS )
240 * .. External Subroutines ..
241 EXTERNAL ALAERH, ALAHD, ALASUM, SERRLQ, SGELQS, SGET02,
242 $ SLACPY, SLARHS, SLATB4, SLATMS, SLQT01, SLQT02,
245 * .. Intrinsic Functions ..
248 * .. Scalars in Common ..
253 * .. Common blocks ..
254 COMMON / INFOC / INFOT, NUNIT, OK, LERR
255 COMMON / SRNAMC / SRNAMT
257 * .. Data statements ..
258 DATA ISEEDY / 1988, 1989, 1990, 1991 /
260 * .. Executable Statements ..
262 * Initialize constants and the random number seed.
264 PATH( 1: 1 ) = 'Single precision'
270 ISEED( I ) = ISEEDY( I )
273 * Test the error exits
276 $ CALL SERRLQ( PATH, NOUT )
281 LWORK = NMAX*MAX( NMAX, NRHS )
283 * Do for each value of M in MVAL.
288 * Do for each value of N in NVAL.
293 DO 50 IMAT = 1, NTYPES
295 * Do the tests only if DOTYPE( IMAT ) is true.
297 IF( .NOT.DOTYPE( IMAT ) )
300 * Set up parameters with SLATB4 and generate a test matrix
303 CALL SLATB4( PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE,
307 CALL SLATMS( M, N, DIST, ISEED, TYPE, RWORK, MODE,
308 $ CNDNUM, ANORM, KL, KU, 'No packing', A, LDA,
311 * Check error code from SLATMS.
314 CALL ALAERH( PATH, 'SLATMS', INFO, 0, ' ', M, N, -1,
315 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
319 * Set some values for K: the first value must be MINMN,
320 * corresponding to the call of SLQT01; other values are
321 * used in the calls of SLQT02, and must not exceed MINMN.
326 KVAL( 4 ) = MINMN / 2
327 IF( MINMN.EQ.0 ) THEN
329 ELSE IF( MINMN.EQ.1 ) THEN
331 ELSE IF( MINMN.LE.3 ) THEN
337 * Do for each value of K in KVAL
342 * Do for each pair of values (NB,NX) in NBVAL and NXVAL.
357 CALL SLQT01( M, N, A, AF, AQ, AL, LDA, TAU,
358 $ WORK, LWORK, RWORK, RESULT( 1 ) )
359 ELSE IF( M.LE.N ) THEN
361 * Test SORGLQ, using factorization
364 CALL SLQT02( M, N, K, A, AF, AQ, AL, LDA, TAU,
365 $ WORK, LWORK, RWORK, RESULT( 1 ) )
369 * Test SORMLQ, using factorization returned
372 CALL SLQT03( M, N, K, AF, AC, AL, AQ, LDA, TAU,
373 $ WORK, LWORK, RWORK, RESULT( 3 ) )
376 * If M>=N and K=N, call SGELQS to solve a system
377 * with NRHS right hand sides and compute the
380 IF( K.EQ.M .AND. INB.EQ.1 ) THEN
382 * Generate a solution and set the right
386 CALL SLARHS( PATH, 'New', 'Full',
387 $ 'No transpose', M, N, 0, 0,
388 $ NRHS, A, LDA, XACT, LDA, B, LDA,
391 CALL SLACPY( 'Full', M, NRHS, B, LDA, X,
394 CALL SGELQS( M, N, NRHS, AF, LDA, TAU, X,
395 $ LDA, WORK, LWORK, INFO )
397 * Check error code from SGELQS.
400 $ CALL ALAERH( PATH, 'SGELQS', INFO, 0, ' ',
401 $ M, N, NRHS, -1, NB, IMAT,
402 $ NFAIL, NERRS, NOUT )
404 CALL SGET02( 'No transpose', M, N, NRHS, A,
405 $ LDA, X, LDA, B, LDA, RWORK,
411 * Print information about the tests that did not
412 * pass the threshold.
415 IF( RESULT( I ).GE.THRESH ) THEN
416 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
417 $ CALL ALAHD( NOUT, PATH )
418 WRITE( NOUT, FMT = 9999 )M, N, K, NB, NX,
419 $ IMAT, I, RESULT( I )
430 * Print a summary of the results.
432 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
434 9999 FORMAT( ' M=', I5, ', N=', I5, ', K=', I5, ', NB=', I4, ', NX=',
435 $ I5, ', type ', I2, ', test(', I2, ')=', G12.5 )