3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE CCHKQ3( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NXVAL,
12 * THRESH, A, COPYA, S, TAU, WORK, RWORK,
15 * .. Scalar Arguments ..
16 * INTEGER NM, NN, NNB, NOUT
19 * .. Array Arguments ..
21 * INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NVAL( * ),
23 * REAL S( * ), RWORK( * )
24 * COMPLEX A( * ), COPYA( * ), TAU( * ), WORK( * )
33 *> CCHKQ3 tests CGEQP3.
41 *> DOTYPE is LOGICAL array, dimension (NTYPES)
42 *> The matrix types to be used for testing. Matrices of type j
43 *> (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) =
44 *> .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used.
50 *> The number of values of M contained in the vector MVAL.
55 *> MVAL is INTEGER array, dimension (NM)
56 *> The values of the matrix row dimension M.
62 *> The number of values of N contained in the vector NVAL.
67 *> NVAL is INTEGER array, dimension (NN)
68 *> The values of the matrix column dimension N.
74 *> The number of values of NB and NX contained in the
75 *> vectors NBVAL and NXVAL. The blocking parameters are used
81 *> NBVAL is INTEGER array, dimension (NNB)
82 *> The values of the blocksize NB.
87 *> NXVAL is INTEGER array, dimension (NNB)
88 *> The values of the crossover point NX.
94 *> The threshold value for the test ratios. A result is
95 *> included in the output file if RESULT >= THRESH. To have
96 *> every test ratio printed, use THRESH = 0.
101 *> A is COMPLEX array, dimension (MMAX*NMAX)
102 *> where MMAX is the maximum value of M in MVAL and NMAX is the
103 *> maximum value of N in NVAL.
108 *> COPYA is COMPLEX array, dimension (MMAX*NMAX)
113 *> S is REAL array, dimension
119 *> TAU is COMPLEX array, dimension (MMAX)
124 *> WORK is COMPLEX array, dimension
125 *> (max(M*max(M,N) + 4*min(M,N) + max(M,N)))
130 *> RWORK is REAL array, dimension (4*NMAX)
135 *> IWORK is INTEGER array, dimension (2*NMAX)
141 *> The unit number for output.
147 *> \author Univ. of Tennessee
148 *> \author Univ. of California Berkeley
149 *> \author Univ. of Colorado Denver
152 *> \date November 2011
154 *> \ingroup complex_lin
156 * =====================================================================
157 SUBROUTINE CCHKQ3( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NXVAL,
158 $ THRESH, A, COPYA, S, TAU, WORK, RWORK,
161 * -- LAPACK test routine (version 3.4.0) --
162 * -- LAPACK is a software package provided by Univ. of Tennessee, --
163 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
166 * .. Scalar Arguments ..
167 INTEGER NM, NN, NNB, NOUT
170 * .. Array Arguments ..
172 INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NVAL( * ),
174 REAL S( * ), RWORK( * )
175 COMPLEX A( * ), COPYA( * ), TAU( * ), WORK( * )
178 * =====================================================================
182 PARAMETER ( NTYPES = 6 )
184 PARAMETER ( NTESTS = 3 )
187 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0,
188 $ CZERO = ( 0.0E+0, 0.0E+0 ) )
190 * .. Local Scalars ..
192 INTEGER I, IHIGH, ILOW, IM, IMODE, IN, INB, INFO,
193 $ ISTEP, K, LDA, LW, LWORK, M, MNMIN, MODE, N,
194 $ NB, NERRS, NFAIL, NRUN, NX
198 INTEGER ISEED( 4 ), ISEEDY( 4 )
199 REAL RESULT( NTESTS )
201 * .. External Functions ..
202 REAL CQPT01, CQRT11, CQRT12, SLAMCH
203 EXTERNAL CQPT01, CQRT11, CQRT12, SLAMCH
205 * .. External Subroutines ..
206 EXTERNAL ALAHD, ALASUM, CGEQP3, CLACPY, CLASET, CLATMS,
207 $ ICOPY, SLAORD, XLAENV
209 * .. Intrinsic Functions ..
212 * .. Scalars in Common ..
215 INTEGER INFOT, IOUNIT
217 * .. Common blocks ..
218 COMMON / INFOC / INFOT, IOUNIT, OK, LERR
219 COMMON / SRNAMC / SRNAMT
221 * .. Data statements ..
222 DATA ISEEDY / 1988, 1989, 1990, 1991 /
224 * .. Executable Statements ..
226 * Initialize constants and the random number seed.
228 PATH( 1: 1 ) = 'Complex precision'
234 ISEED( I ) = ISEEDY( I )
236 EPS = SLAMCH( 'Epsilon' )
241 * Do for each value of M in MVAL.
248 * Do for each value of N in NVAL.
252 LWORK = MAX( 1, M*MAX( M, N )+4*MNMIN+MAX( M, N ) )
254 DO 70 IMODE = 1, NTYPES
255 IF( .NOT.DOTYPE( IMODE ) )
258 * Do for each type of matrix
260 * 2: one small singular value
261 * 3: geometric distribution of singular values
262 * 4: first n/2 columns fixed
263 * 5: last n/2 columns fixed
264 * 6: every second column fixed
270 * Generate test matrix of size m by n using
271 * singular value distribution indicated by `mode'.
276 IF( IMODE.EQ.1 ) THEN
277 CALL CLASET( 'Full', M, N, CZERO, CZERO, COPYA, LDA )
282 CALL CLATMS( M, N, 'Uniform', ISEED, 'Nonsymm', S,
283 $ MODE, ONE / EPS, ONE, M, N, 'No packing',
284 $ COPYA, LDA, WORK, INFO )
285 IF( IMODE.GE.4 ) THEN
286 IF( IMODE.EQ.4 ) THEN
289 IHIGH = MAX( 1, N / 2 )
290 ELSE IF( IMODE.EQ.5 ) THEN
291 ILOW = MAX( 1, N / 2 )
294 ELSE IF( IMODE.EQ.6 ) THEN
299 DO 40 I = ILOW, IHIGH, ISTEP
303 CALL SLAORD( 'Decreasing', MNMIN, S, 1 )
308 * Do for each pair of values (NB,NX) in NBVAL and NXVAL.
315 * Save A and its singular values and a copy of
318 CALL CLACPY( 'All', M, N, COPYA, LDA, A, LDA )
319 CALL ICOPY( N, IWORK( 1 ), 1, IWORK( N+1 ), 1 )
326 CALL CGEQP3( M, N, A, LDA, IWORK( N+1 ), TAU, WORK,
329 * Compute norm(svd(a) - svd(r))
331 RESULT( 1 ) = CQRT12( M, N, A, LDA, S, WORK,
334 * Compute norm( A*P - Q*R )
336 RESULT( 2 ) = CQPT01( M, N, MNMIN, COPYA, A, LDA, TAU,
337 $ IWORK( N+1 ), WORK, LWORK )
341 RESULT( 3 ) = CQRT11( M, MNMIN, A, LDA, TAU, WORK,
344 * Print information about the tests that did not pass
348 IF( RESULT( K ).GE.THRESH ) THEN
349 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
350 $ CALL ALAHD( NOUT, PATH )
351 WRITE( NOUT, FMT = 9999 )'CGEQP3', M, N, NB,
352 $ IMODE, K, RESULT( K )
363 * Print a summary of the results.
365 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
367 9999 FORMAT( 1X, A, ' M =', I5, ', N =', I5, ', NB =', I4, ', type ',
368 $ I2, ', test ', I2, ', ratio =', G12.5 )