3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE DCHKBD( NSIZES, MVAL, NVAL, NTYPES, DOTYPE, NRHS,
12 * ISEED, THRESH, A, LDA, BD, BE, S1, S2, X, LDX,
13 * Y, Z, Q, LDQ, PT, LDPT, U, VT, WORK, LWORK,
16 * .. Scalar Arguments ..
17 * INTEGER INFO, LDA, LDPT, LDQ, LDX, LWORK, NOUT, NRHS,
19 * DOUBLE PRECISION THRESH
21 * .. Array Arguments ..
23 * INTEGER ISEED( 4 ), IWORK( * ), MVAL( * ), NVAL( * )
24 * DOUBLE PRECISION A( LDA, * ), BD( * ), BE( * ), PT( LDPT, * ),
25 * $ Q( LDQ, * ), S1( * ), S2( * ), U( LDPT, * ),
26 * $ VT( LDPT, * ), WORK( * ), X( LDX, * ),
27 * $ Y( LDX, * ), Z( LDX, * )
36 *> DCHKBD checks the singular value decomposition (SVD) routines.
38 *> DGEBRD reduces a real general m by n matrix A to upper or lower
39 *> bidiagonal form B by an orthogonal transformation: Q' * A * P = B
40 *> (or A = Q * B * P'). The matrix B is upper bidiagonal if m >= n
41 *> and lower bidiagonal if m < n.
43 *> DORGBR generates the orthogonal matrices Q and P' from DGEBRD.
44 *> Note that Q and P are not necessarily square.
46 *> DBDSQR computes the singular value decomposition of the bidiagonal
47 *> matrix B as B = U S V'. It is called three times to compute
48 *> 1) B = U S1 V', where S1 is the diagonal matrix of singular
49 *> values and the columns of the matrices U and V are the left
50 *> and right singular vectors, respectively, of B.
51 *> 2) Same as 1), but the singular values are stored in S2 and the
52 *> singular vectors are not computed.
53 *> 3) A = (UQ) S (P'V'), the SVD of the original matrix A.
54 *> In addition, DBDSQR has an option to apply the left orthogonal matrix
55 *> U to a matrix X, useful in least squares applications.
57 *> DBDSDC computes the singular value decomposition of the bidiagonal
58 *> matrix B as B = U S V' using divide-and-conquer. It is called twice
60 *> 1) B = U S1 V', where S1 is the diagonal matrix of singular
61 *> values and the columns of the matrices U and V are the left
62 *> and right singular vectors, respectively, of B.
63 *> 2) Same as 1), but the singular values are stored in S2 and the
64 *> singular vectors are not computed.
66 *> DBDSVDX computes the singular value decomposition of the bidiagonal
67 *> matrix B as B = U S V' using bisection and inverse iteration. It is
68 *> called six times to compute
69 *> 1) B = U S1 V', RANGE='A', where S1 is the diagonal matrix of singular
70 *> values and the columns of the matrices U and V are the left
71 *> and right singular vectors, respectively, of B.
72 *> 2) Same as 1), but the singular values are stored in S2 and the
73 *> singular vectors are not computed.
74 *> 3) B = U S1 V', RANGE='I', with where S1 is the diagonal matrix of singular
75 *> values and the columns of the matrices U and V are the left
76 *> and right singular vectors, respectively, of B
77 *> 4) Same as 3), but the singular values are stored in S2 and the
78 *> singular vectors are not computed.
79 *> 5) B = U S1 V', RANGE='V', with where S1 is the diagonal matrix of singular
80 *> values and the columns of the matrices U and V are the left
81 *> and right singular vectors, respectively, of B
82 *> 6) Same as 5), but the singular values are stored in S2 and the
83 *> singular vectors are not computed.
85 *> For each pair of matrix dimensions (M,N) and each selected matrix
86 *> type, an M by N matrix A and an M by NRHS matrix X are generated.
87 *> The problem dimensions are as follows
89 *> Q: M x min(M,N) (but M x M if NRHS > 0)
91 *> B: min(M,N) x min(M,N)
92 *> U, V: min(M,N) x min(M,N)
93 *> S1, S2 diagonal, order min(M,N)
96 *> For each generated matrix, 14 tests are performed:
98 *> Test DGEBRD and DORGBR
100 *> (1) | A - Q B PT | / ( |A| max(M,N) ulp ), PT = P'
102 *> (2) | I - Q' Q | / ( M ulp )
104 *> (3) | I - PT PT' | / ( N ulp )
106 *> Test DBDSQR on bidiagonal matrix B
108 *> (4) | B - U S1 VT | / ( |B| min(M,N) ulp ), VT = V'
110 *> (5) | Y - U Z | / ( |Y| max(min(M,N),k) ulp ), where Y = Q' X
112 *> (6) | I - U' U | / ( min(M,N) ulp )
114 *> (7) | I - VT VT' | / ( min(M,N) ulp )
116 *> (8) S1 contains min(M,N) nonnegative values in decreasing order.
117 *> (Return 0 if true, 1/ULP if false.)
119 *> (9) | S1 - S2 | / ( |S1| ulp ), where S2 is computed without
120 *> computing U and V.
122 *> (10) 0 if the true singular values of B are within THRESH of
123 *> those in S1. 2*THRESH if they are not. (Tested using
126 *> Test DBDSQR on matrix A
128 *> (11) | A - (QU) S (VT PT) | / ( |A| max(M,N) ulp )
130 *> (12) | X - (QU) Z | / ( |X| max(M,k) ulp )
132 *> (13) | I - (QU)'(QU) | / ( M ulp )
134 *> (14) | I - (VT PT) (PT'VT') | / ( N ulp )
136 *> Test DBDSDC on bidiagonal matrix B
138 *> (15) | B - U S1 VT | / ( |B| min(M,N) ulp ), VT = V'
140 *> (16) | I - U' U | / ( min(M,N) ulp )
142 *> (17) | I - VT VT' | / ( min(M,N) ulp )
144 *> (18) S1 contains min(M,N) nonnegative values in decreasing order.
145 *> (Return 0 if true, 1/ULP if false.)
147 *> (19) | S1 - S2 | / ( |S1| ulp ), where S2 is computed without
148 *> computing U and V.
149 *> Test DBDSVDX on bidiagonal matrix B
151 *> (20) | B - U S1 VT | / ( |B| min(M,N) ulp ), VT = V'
153 *> (21) | I - U' U | / ( min(M,N) ulp )
155 *> (22) | I - VT VT' | / ( min(M,N) ulp )
157 *> (23) S1 contains min(M,N) nonnegative values in decreasing order.
158 *> (Return 0 if true, 1/ULP if false.)
160 *> (24) | S1 - S2 | / ( |S1| ulp ), where S2 is computed without
161 *> computing U and V.
163 *> (25) | S1 - U' B VT' | / ( |S| n ulp ) DBDSVDX('V', 'I')
165 *> (26) | I - U' U | / ( min(M,N) ulp )
167 *> (27) | I - VT VT' | / ( min(M,N) ulp )
169 *> (28) S1 contains min(M,N) nonnegative values in decreasing order.
170 *> (Return 0 if true, 1/ULP if false.)
172 *> (29) | S1 - S2 | / ( |S1| ulp ), where S2 is computed without
173 *> computing U and V.
175 *> (30) | S1 - U' B VT' | / ( |S1| n ulp ) DBDSVDX('V', 'V')
177 *> (31) | I - U' U | / ( min(M,N) ulp )
179 *> (32) | I - VT VT' | / ( min(M,N) ulp )
181 *> (33) S1 contains min(M,N) nonnegative values in decreasing order.
182 *> (Return 0 if true, 1/ULP if false.)
184 *> (34) | S1 - S2 | / ( |S1| ulp ), where S2 is computed without
185 *> computing U and V.
187 *> The possible matrix types are
189 *> (1) The zero matrix.
190 *> (2) The identity matrix.
192 *> (3) A diagonal matrix with evenly spaced entries
193 *> 1, ..., ULP and random signs.
194 *> (ULP = (first number larger than 1) - 1 )
195 *> (4) A diagonal matrix with geometrically spaced entries
196 *> 1, ..., ULP and random signs.
197 *> (5) A diagonal matrix with "clustered" entries 1, ULP, ..., ULP
200 *> (6) Same as (3), but multiplied by SQRT( overflow threshold )
201 *> (7) Same as (3), but multiplied by SQRT( underflow threshold )
203 *> (8) A matrix of the form U D V, where U and V are orthogonal and
204 *> D has evenly spaced entries 1, ..., ULP with random signs
207 *> (9) A matrix of the form U D V, where U and V are orthogonal and
208 *> D has geometrically spaced entries 1, ..., ULP with random
209 *> signs on the diagonal.
211 *> (10) A matrix of the form U D V, where U and V are orthogonal and
212 *> D has "clustered" entries 1, ULP,..., ULP with random
213 *> signs on the diagonal.
215 *> (11) Same as (8), but multiplied by SQRT( overflow threshold )
216 *> (12) Same as (8), but multiplied by SQRT( underflow threshold )
218 *> (13) Rectangular matrix with random entries chosen from (-1,1).
219 *> (14) Same as (13), but multiplied by SQRT( overflow threshold )
220 *> (15) Same as (13), but multiplied by SQRT( underflow threshold )
223 *> (16) A bidiagonal matrix with random entries chosen from a
224 *> logarithmic distribution on [ulp^2,ulp^(-2)] (I.e., each
225 *> entry is e^x, where x is chosen uniformly on
226 *> [ 2 log(ulp), -2 log(ulp) ] .) For *this* type:
227 *> (a) DGEBRD is not called to reduce it to bidiagonal form.
228 *> (b) the bidiagonal is min(M,N) x min(M,N); if M<N, the
229 *> matrix will be lower bidiagonal, otherwise upper.
230 *> (c) only tests 5--8 and 14 are performed.
232 *> A subset of the full set of matrix types may be selected through
233 *> the logical array DOTYPE.
242 *> The number of values of M and N contained in the vectors
243 *> MVAL and NVAL. The matrix sizes are used in pairs (M,N).
248 *> MVAL is INTEGER array, dimension (NM)
249 *> The values of the matrix row dimension M.
254 *> NVAL is INTEGER array, dimension (NM)
255 *> The values of the matrix column dimension N.
261 *> The number of elements in DOTYPE. If it is zero, DCHKBD
262 *> does nothing. It must be at least zero. If it is MAXTYP+1
263 *> and NSIZES is 1, then an additional type, MAXTYP+1 is
264 *> defined, which is to use whatever matrices are in A and B.
265 *> This is only useful if DOTYPE(1:MAXTYP) is .FALSE. and
266 *> DOTYPE(MAXTYP+1) is .TRUE. .
271 *> DOTYPE is LOGICAL array, dimension (NTYPES)
272 *> If DOTYPE(j) is .TRUE., then for each size (m,n), a matrix
273 *> of type j will be generated. If NTYPES is smaller than the
274 *> maximum number of types defined (PARAMETER MAXTYP), then
275 *> types NTYPES+1 through MAXTYP will not be generated. If
276 *> NTYPES is larger than MAXTYP, DOTYPE(MAXTYP+1) through
277 *> DOTYPE(NTYPES) will be ignored.
283 *> The number of columns in the "right-hand side" matrices X, Y,
284 *> and Z, used in testing DBDSQR. If NRHS = 0, then the
285 *> operations on the right-hand side will not be tested.
286 *> NRHS must be at least 0.
289 *> \param[in,out] ISEED
291 *> ISEED is INTEGER array, dimension (4)
292 *> On entry ISEED specifies the seed of the random number
293 *> generator. The array elements should be between 0 and 4095;
294 *> if not they will be reduced mod 4096. Also, ISEED(4) must
295 *> be odd. The values of ISEED are changed on exit, and can be
296 *> used in the next call to DCHKBD to continue the same random
302 *> THRESH is DOUBLE PRECISION
303 *> The threshold value for the test ratios. A result is
304 *> included in the output file if RESULT >= THRESH. To have
305 *> every test ratio printed, use THRESH = 0. Note that the
306 *> expected value of the test ratios is O(1), so THRESH should
307 *> be a reasonably small multiple of 1, e.g., 10 or 100.
312 *> A is DOUBLE PRECISION array, dimension (LDA,NMAX)
313 *> where NMAX is the maximum value of N in NVAL.
319 *> The leading dimension of the array A. LDA >= max(1,MMAX),
320 *> where MMAX is the maximum value of M in MVAL.
325 *> BD is DOUBLE PRECISION array, dimension
326 *> (max(min(MVAL(j),NVAL(j))))
331 *> BE is DOUBLE PRECISION array, dimension
332 *> (max(min(MVAL(j),NVAL(j))))
337 *> S1 is DOUBLE PRECISION array, dimension
338 *> (max(min(MVAL(j),NVAL(j))))
343 *> S2 is DOUBLE PRECISION array, dimension
344 *> (max(min(MVAL(j),NVAL(j))))
349 *> X is DOUBLE PRECISION array, dimension (LDX,NRHS)
355 *> The leading dimension of the arrays X, Y, and Z.
356 *> LDX >= max(1,MMAX)
361 *> Y is DOUBLE PRECISION array, dimension (LDX,NRHS)
366 *> Z is DOUBLE PRECISION array, dimension (LDX,NRHS)
371 *> Q is DOUBLE PRECISION array, dimension (LDQ,MMAX)
377 *> The leading dimension of the array Q. LDQ >= max(1,MMAX).
382 *> PT is DOUBLE PRECISION array, dimension (LDPT,NMAX)
388 *> The leading dimension of the arrays PT, U, and V.
389 *> LDPT >= max(1, max(min(MVAL(j),NVAL(j)))).
394 *> U is DOUBLE PRECISION array, dimension
395 *> (LDPT,max(min(MVAL(j),NVAL(j))))
400 *> VT is DOUBLE PRECISION array, dimension
401 *> (LDPT,max(min(MVAL(j),NVAL(j))))
406 *> WORK is DOUBLE PRECISION array, dimension (LWORK)
412 *> The number of entries in WORK. This must be at least
413 *> 3(M+N) and M(M + max(M,N,k) + 1) + N*min(M,N) for all
414 *> pairs (M,N)=(MM(j),NN(j))
419 *> IWORK is INTEGER array, dimension at least 8*min(M,N)
425 *> The FORTRAN unit number for printing out error messages
426 *> (e.g., if a routine returns IINFO not equal to 0.)
432 *> If 0, then everything ran OK.
434 *> -2: Some MM(j) < 0
435 *> -3: Some NN(j) < 0
439 *> -11: LDA < 1 or LDA < MMAX, where MMAX is max( MM(j) ).
440 *> -17: LDB < 1 or LDB < MMAX.
441 *> -21: LDQ < 1 or LDQ < MMAX.
442 *> -23: LDPT< 1 or LDPT< MNMAX.
443 *> -27: LWORK too small.
444 *> If DLATMR, SLATMS, DGEBRD, DORGBR, or DBDSQR,
445 *> returns an error code, the
446 *> absolute value of it is returned.
448 *>-----------------------------------------------------------------------
450 *> Some Local Variables and Parameters:
451 *> ---- ----- --------- --- ----------
453 *> ZERO, ONE Real 0 and 1.
454 *> MAXTYP The number of types defined.
455 *> NTEST The number of tests performed, or which can
456 *> be performed so far, for the current matrix.
457 *> MMAX Largest value in NN.
458 *> NMAX Largest value in NN.
459 *> MNMIN min(MM(j), NN(j)) (the dimension of the bidiagonal
461 *> MNMAX The maximum value of MNMIN for j=1,...,NSIZES.
462 *> NFAIL The number of tests which have exceeded THRESH
463 *> COND, IMODE Values to be passed to the matrix generators.
464 *> ANORM Norm of A; passed to matrix generators.
466 *> OVFL, UNFL Overflow and underflow thresholds.
467 *> RTOVFL, RTUNFL Square roots of the previous 2 values.
468 *> ULP, ULPINV Finest relative precision and its inverse.
470 *> The following four arrays decode JTYPE:
471 *> KTYPE(j) The general type (1-10) for type "j".
472 *> KMODE(j) The MODE value to be passed to the matrix
473 *> generator for type "j".
474 *> KMAGN(j) The order of magnitude ( O(1),
475 *> O(overflow^(1/2) ), O(underflow^(1/2) )
481 *> \author Univ. of Tennessee
482 *> \author Univ. of California Berkeley
483 *> \author Univ. of Colorado Denver
488 *> \ingroup double_eig
490 * =====================================================================
491 SUBROUTINE DCHKBD( NSIZES, MVAL, NVAL, NTYPES, DOTYPE, NRHS,
492 $ ISEED, THRESH, A, LDA, BD, BE, S1, S2, X, LDX,
493 $ Y, Z, Q, LDQ, PT, LDPT, U, VT, WORK, LWORK,
494 $ IWORK, NOUT, INFO )
496 * -- LAPACK test routine (version 3.6.1) --
497 * -- LAPACK is a software package provided by Univ. of Tennessee, --
498 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
501 * .. Scalar Arguments ..
502 INTEGER INFO, LDA, LDPT, LDQ, LDX, LWORK, NOUT, NRHS,
504 DOUBLE PRECISION THRESH
506 * .. Array Arguments ..
508 INTEGER ISEED( 4 ), IWORK( * ), MVAL( * ), NVAL( * )
509 DOUBLE PRECISION A( LDA, * ), BD( * ), BE( * ), PT( LDPT, * ),
510 $ Q( LDQ, * ), S1( * ), S2( * ), U( LDPT, * ),
511 $ VT( LDPT, * ), WORK( * ), X( LDX, * ),
512 $ Y( LDX, * ), Z( LDX, * )
515 * ======================================================================
518 DOUBLE PRECISION ZERO, ONE, TWO, HALF
519 PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0, TWO = 2.0D0,
522 PARAMETER ( MAXTYP = 16 )
524 * .. Local Scalars ..
525 LOGICAL BADMM, BADNN, BIDIAG
528 INTEGER I, IINFO, IL, IMODE, ITEMP, ITYPE, IU, IWBD,
529 $ IWBE, IWBS, IWBZ, IWWORK, J, JCOL, JSIZE,
530 $ JTYPE, LOG2UI, M, MINWRK, MMAX, MNMAX, MNMIN,
531 $ MNMIN2, MQ, MTYPES, N, NFAIL, NMAX,
533 DOUBLE PRECISION ABSTOL, AMNINV, ANORM, COND, OVFL, RTOVFL,
534 $ RTUNFL, TEMP1, TEMP2, TEMP3, ULP, ULPINV,
538 INTEGER IDUM( 1 ), IOLDSD( 4 ), ISEED2( 4 ),
539 $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
541 DOUBLE PRECISION DUM( 1 ), DUMMA( 1 ), RESULT( 40 )
543 * .. External Functions ..
544 DOUBLE PRECISION DLAMCH, DLARND, DSXT1
545 EXTERNAL DLAMCH, DLARND, DSXT1
547 * .. External Subroutines ..
548 EXTERNAL ALASUM, DBDSDC, DBDSQR, DBDSVDX, DBDT01,
549 $ DBDT02, DBDT03, DBDT04, DCOPY, DGEBRD,
550 $ DGEMM, DLABAD, DLACPY, DLAHD2, DLASET,
551 $ DLATMR, DLATMS, DORGBR, DORT01, XERBLA
553 * .. Intrinsic Functions ..
554 INTRINSIC ABS, EXP, INT, LOG, MAX, MIN, SQRT
556 * .. Scalars in Common ..
561 * .. Common blocks ..
562 COMMON / INFOC / INFOT, NUNIT, OK, LERR
563 COMMON / SRNAMC / SRNAMT
565 * .. Data statements ..
566 DATA KTYPE / 1, 2, 5*4, 5*6, 3*9, 10 /
567 DATA KMAGN / 2*1, 3*1, 2, 3, 3*1, 2, 3, 1, 2, 3, 0 /
568 DATA KMODE / 2*0, 4, 3, 1, 4, 4, 4, 3, 1, 4, 4, 0,
571 * .. Executable Statements ..
584 MMAX = MAX( MMAX, MVAL( J ) )
587 NMAX = MAX( NMAX, NVAL( J ) )
590 MNMAX = MAX( MNMAX, MIN( MVAL( J ), NVAL( J ) ) )
591 MINWRK = MAX( MINWRK, 3*( MVAL( J )+NVAL( J ) ),
592 $ MVAL( J )*( MVAL( J )+MAX( MVAL( J ), NVAL( J ),
593 $ NRHS )+1 )+NVAL( J )*MIN( NVAL( J ), MVAL( J ) ) )
598 IF( NSIZES.LT.0 ) THEN
600 ELSE IF( BADMM ) THEN
602 ELSE IF( BADNN ) THEN
604 ELSE IF( NTYPES.LT.0 ) THEN
606 ELSE IF( NRHS.LT.0 ) THEN
608 ELSE IF( LDA.LT.MMAX ) THEN
610 ELSE IF( LDX.LT.MMAX ) THEN
612 ELSE IF( LDQ.LT.MMAX ) THEN
614 ELSE IF( LDPT.LT.MNMAX ) THEN
616 ELSE IF( MINWRK.GT.LWORK ) THEN
621 CALL XERBLA( 'DCHKBD', -INFO )
625 * Initialize constants
627 PATH( 1: 1 ) = 'Double precision'
631 UNFL = DLAMCH( 'Safe minimum' )
632 OVFL = DLAMCH( 'Overflow' )
633 CALL DLABAD( UNFL, OVFL )
634 ULP = DLAMCH( 'Precision' )
636 LOG2UI = INT( LOG( ULPINV ) / LOG( TWO ) )
637 RTUNFL = SQRT( UNFL )
638 RTOVFL = SQRT( OVFL )
642 * Loop over sizes, types
644 DO 300 JSIZE = 1, NSIZES
648 AMNINV = ONE / MAX( M, N, 1 )
650 IF( NSIZES.NE.1 ) THEN
651 MTYPES = MIN( MAXTYP, NTYPES )
653 MTYPES = MIN( MAXTYP+1, NTYPES )
656 DO 290 JTYPE = 1, MTYPES
657 IF( .NOT.DOTYPE( JTYPE ) )
661 IOLDSD( J ) = ISEED( J )
672 * Control parameters:
675 * =1 O(1) clustered 1 zero
676 * =2 large clustered 2 identity
677 * =3 small exponential (none)
678 * =4 arithmetic diagonal, (w/ eigenvalues)
679 * =5 random symmetric, w/ eigenvalues
680 * =6 nonsymmetric, w/ singular values
682 * =8 random symmetric
683 * =9 random nonsymmetric
684 * =10 random bidiagonal (log. distrib.)
686 IF( MTYPES.GT.MAXTYP )
689 ITYPE = KTYPE( JTYPE )
690 IMODE = KMODE( JTYPE )
694 GO TO ( 40, 50, 60 )KMAGN( JTYPE )
701 ANORM = ( RTOVFL*ULP )*AMNINV
705 ANORM = RTUNFL*MAX( M, N )*ULPINV
710 CALL DLASET( 'Full', LDA, N, ZERO, ZERO, A, LDA )
715 IF( ITYPE.EQ.1 ) THEN
721 ELSE IF( ITYPE.EQ.2 ) THEN
725 DO 80 JCOL = 1, MNMIN
726 A( JCOL, JCOL ) = ANORM
729 ELSE IF( ITYPE.EQ.4 ) THEN
731 * Diagonal Matrix, [Eigen]values Specified
733 CALL DLATMS( MNMIN, MNMIN, 'S', ISEED, 'N', WORK, IMODE,
734 $ COND, ANORM, 0, 0, 'N', A, LDA,
735 $ WORK( MNMIN+1 ), IINFO )
737 ELSE IF( ITYPE.EQ.5 ) THEN
739 * Symmetric, eigenvalues specified
741 CALL DLATMS( MNMIN, MNMIN, 'S', ISEED, 'S', WORK, IMODE,
742 $ COND, ANORM, M, N, 'N', A, LDA,
743 $ WORK( MNMIN+1 ), IINFO )
745 ELSE IF( ITYPE.EQ.6 ) THEN
747 * Nonsymmetric, singular values specified
749 CALL DLATMS( M, N, 'S', ISEED, 'N', WORK, IMODE, COND,
750 $ ANORM, M, N, 'N', A, LDA, WORK( MNMIN+1 ),
753 ELSE IF( ITYPE.EQ.7 ) THEN
755 * Diagonal, random entries
757 CALL DLATMR( MNMIN, MNMIN, 'S', ISEED, 'N', WORK, 6, ONE,
758 $ ONE, 'T', 'N', WORK( MNMIN+1 ), 1, ONE,
759 $ WORK( 2*MNMIN+1 ), 1, ONE, 'N', IWORK, 0, 0,
760 $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )
762 ELSE IF( ITYPE.EQ.8 ) THEN
764 * Symmetric, random entries
766 CALL DLATMR( MNMIN, MNMIN, 'S', ISEED, 'S', WORK, 6, ONE,
767 $ ONE, 'T', 'N', WORK( MNMIN+1 ), 1, ONE,
768 $ WORK( M+MNMIN+1 ), 1, ONE, 'N', IWORK, M, N,
769 $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )
771 ELSE IF( ITYPE.EQ.9 ) THEN
773 * Nonsymmetric, random entries
775 CALL DLATMR( M, N, 'S', ISEED, 'N', WORK, 6, ONE, ONE,
776 $ 'T', 'N', WORK( MNMIN+1 ), 1, ONE,
777 $ WORK( M+MNMIN+1 ), 1, ONE, 'N', IWORK, M, N,
778 $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )
780 ELSE IF( ITYPE.EQ.10 ) THEN
782 * Bidiagonal, random entries
784 TEMP1 = -TWO*LOG( ULP )
786 BD( J ) = EXP( TEMP1*DLARND( 2, ISEED ) )
788 $ BE( J ) = EXP( TEMP1*DLARND( 2, ISEED ) )
802 IF( IINFO.EQ.0 ) THEN
804 * Generate Right-Hand Side
807 CALL DLATMR( MNMIN, NRHS, 'S', ISEED, 'N', WORK, 6,
808 $ ONE, ONE, 'T', 'N', WORK( MNMIN+1 ), 1,
809 $ ONE, WORK( 2*MNMIN+1 ), 1, ONE, 'N',
810 $ IWORK, MNMIN, NRHS, ZERO, ONE, 'NO', Y,
811 $ LDX, IWORK, IINFO )
813 CALL DLATMR( M, NRHS, 'S', ISEED, 'N', WORK, 6, ONE,
814 $ ONE, 'T', 'N', WORK( M+1 ), 1, ONE,
815 $ WORK( 2*M+1 ), 1, ONE, 'N', IWORK, M,
816 $ NRHS, ZERO, ONE, 'NO', X, LDX, IWORK,
823 IF( IINFO.NE.0 ) THEN
824 WRITE( NOUT, FMT = 9998 )'Generator', IINFO, M, N,
832 * Call DGEBRD and DORGBR to compute B, Q, and P, do tests.
834 IF( .NOT.BIDIAG ) THEN
836 * Compute transformations to reduce A to bidiagonal form:
839 CALL DLACPY( ' ', M, N, A, LDA, Q, LDQ )
840 CALL DGEBRD( M, N, Q, LDQ, BD, BE, WORK, WORK( MNMIN+1 ),
841 $ WORK( 2*MNMIN+1 ), LWORK-2*MNMIN, IINFO )
843 * Check error code from DGEBRD.
845 IF( IINFO.NE.0 ) THEN
846 WRITE( NOUT, FMT = 9998 )'DGEBRD', IINFO, M, N,
852 CALL DLACPY( ' ', M, N, Q, LDQ, PT, LDPT )
864 CALL DORGBR( 'Q', M, MQ, N, Q, LDQ, WORK,
865 $ WORK( 2*MNMIN+1 ), LWORK-2*MNMIN, IINFO )
867 * Check error code from DORGBR.
869 IF( IINFO.NE.0 ) THEN
870 WRITE( NOUT, FMT = 9998 )'DORGBR(Q)', IINFO, M, N,
878 CALL DORGBR( 'P', MNMIN, N, M, PT, LDPT, WORK( MNMIN+1 ),
879 $ WORK( 2*MNMIN+1 ), LWORK-2*MNMIN, IINFO )
881 * Check error code from DORGBR.
883 IF( IINFO.NE.0 ) THEN
884 WRITE( NOUT, FMT = 9998 )'DORGBR(P)', IINFO, M, N,
890 * Apply Q' to an M by NRHS matrix X: Y := Q' * X.
892 CALL DGEMM( 'Transpose', 'No transpose', M, NRHS, M, ONE,
893 $ Q, LDQ, X, LDX, ZERO, Y, LDX )
895 * Test 1: Check the decomposition A := Q * B * PT
896 * 2: Check the orthogonality of Q
897 * 3: Check the orthogonality of PT
899 CALL DBDT01( M, N, 1, A, LDA, Q, LDQ, BD, BE, PT, LDPT,
900 $ WORK, RESULT( 1 ) )
901 CALL DORT01( 'Columns', M, MQ, Q, LDQ, WORK, LWORK,
903 CALL DORT01( 'Rows', MNMIN, N, PT, LDPT, WORK, LWORK,
907 * Use DBDSQR to form the SVD of the bidiagonal matrix B:
908 * B := U * S1 * VT, and compute Z = U' * Y.
910 CALL DCOPY( MNMIN, BD, 1, S1, 1 )
912 $ CALL DCOPY( MNMIN-1, BE, 1, WORK, 1 )
913 CALL DLACPY( ' ', M, NRHS, Y, LDX, Z, LDX )
914 CALL DLASET( 'Full', MNMIN, MNMIN, ZERO, ONE, U, LDPT )
915 CALL DLASET( 'Full', MNMIN, MNMIN, ZERO, ONE, VT, LDPT )
917 CALL DBDSQR( UPLO, MNMIN, MNMIN, MNMIN, NRHS, S1, WORK, VT,
918 $ LDPT, U, LDPT, Z, LDX, WORK( MNMIN+1 ), IINFO )
920 * Check error code from DBDSQR.
922 IF( IINFO.NE.0 ) THEN
923 WRITE( NOUT, FMT = 9998 )'DBDSQR(vects)', IINFO, M, N,
926 IF( IINFO.LT.0 ) THEN
934 * Use DBDSQR to compute only the singular values of the
935 * bidiagonal matrix B; U, VT, and Z should not be modified.
937 CALL DCOPY( MNMIN, BD, 1, S2, 1 )
939 $ CALL DCOPY( MNMIN-1, BE, 1, WORK, 1 )
941 CALL DBDSQR( UPLO, MNMIN, 0, 0, 0, S2, WORK, VT, LDPT, U,
942 $ LDPT, Z, LDX, WORK( MNMIN+1 ), IINFO )
944 * Check error code from DBDSQR.
946 IF( IINFO.NE.0 ) THEN
947 WRITE( NOUT, FMT = 9998 )'DBDSQR(values)', IINFO, M, N,
950 IF( IINFO.LT.0 ) THEN
958 * Test 4: Check the decomposition B := U * S1 * VT
959 * 5: Check the computation Z := U' * Y
960 * 6: Check the orthogonality of U
961 * 7: Check the orthogonality of VT
963 CALL DBDT03( UPLO, MNMIN, 1, BD, BE, U, LDPT, S1, VT, LDPT,
964 $ WORK, RESULT( 4 ) )
965 CALL DBDT02( MNMIN, NRHS, Y, LDX, Z, LDX, U, LDPT, WORK,
967 CALL DORT01( 'Columns', MNMIN, MNMIN, U, LDPT, WORK, LWORK,
969 CALL DORT01( 'Rows', MNMIN, MNMIN, VT, LDPT, WORK, LWORK,
972 * Test 8: Check that the singular values are sorted in
973 * non-increasing order and are non-negative
976 DO 110 I = 1, MNMIN - 1
977 IF( S1( I ).LT.S1( I+1 ) )
978 $ RESULT( 8 ) = ULPINV
979 IF( S1( I ).LT.ZERO )
980 $ RESULT( 8 ) = ULPINV
982 IF( MNMIN.GE.1 ) THEN
983 IF( S1( MNMIN ).LT.ZERO )
984 $ RESULT( 8 ) = ULPINV
987 * Test 9: Compare DBDSQR with and without singular vectors
992 TEMP1 = ABS( S1( J )-S2( J ) ) /
993 $ MAX( SQRT( UNFL )*MAX( S1( 1 ), ONE ),
994 $ ULP*MAX( ABS( S1( J ) ), ABS( S2( J ) ) ) )
995 TEMP2 = MAX( TEMP1, TEMP2 )
1000 * Test 10: Sturm sequence test of singular values
1001 * Go up by factors of two until it succeeds
1003 TEMP1 = THRESH*( HALF-ULP )
1005 DO 130 J = 0, LOG2UI
1006 * CALL DSVDCH( MNMIN, BD, BE, S1, TEMP1, IINFO )
1013 RESULT( 10 ) = TEMP1
1015 * Use DBDSQR to form the decomposition A := (QU) S (VT PT)
1016 * from the bidiagonal form A := Q B PT.
1018 IF( .NOT.BIDIAG ) THEN
1019 CALL DCOPY( MNMIN, BD, 1, S2, 1 )
1021 $ CALL DCOPY( MNMIN-1, BE, 1, WORK, 1 )
1023 CALL DBDSQR( UPLO, MNMIN, N, M, NRHS, S2, WORK, PT, LDPT,
1024 $ Q, LDQ, Y, LDX, WORK( MNMIN+1 ), IINFO )
1026 * Test 11: Check the decomposition A := Q*U * S2 * VT*PT
1027 * 12: Check the computation Z := U' * Q' * X
1028 * 13: Check the orthogonality of Q*U
1029 * 14: Check the orthogonality of VT*PT
1031 CALL DBDT01( M, N, 0, A, LDA, Q, LDQ, S2, DUMMA, PT,
1032 $ LDPT, WORK, RESULT( 11 ) )
1033 CALL DBDT02( M, NRHS, X, LDX, Y, LDX, Q, LDQ, WORK,
1035 CALL DORT01( 'Columns', M, MQ, Q, LDQ, WORK, LWORK,
1037 CALL DORT01( 'Rows', MNMIN, N, PT, LDPT, WORK, LWORK,
1041 * Use DBDSDC to form the SVD of the bidiagonal matrix B:
1044 CALL DCOPY( MNMIN, BD, 1, S1, 1 )
1046 $ CALL DCOPY( MNMIN-1, BE, 1, WORK, 1 )
1047 CALL DLASET( 'Full', MNMIN, MNMIN, ZERO, ONE, U, LDPT )
1048 CALL DLASET( 'Full', MNMIN, MNMIN, ZERO, ONE, VT, LDPT )
1050 CALL DBDSDC( UPLO, 'I', MNMIN, S1, WORK, U, LDPT, VT, LDPT,
1051 $ DUM, IDUM, WORK( MNMIN+1 ), IWORK, IINFO )
1053 * Check error code from DBDSDC.
1055 IF( IINFO.NE.0 ) THEN
1056 WRITE( NOUT, FMT = 9998 )'DBDSDC(vects)', IINFO, M, N,
1059 IF( IINFO.LT.0 ) THEN
1062 RESULT( 15 ) = ULPINV
1067 * Use DBDSDC to compute only the singular values of the
1068 * bidiagonal matrix B; U and VT should not be modified.
1070 CALL DCOPY( MNMIN, BD, 1, S2, 1 )
1072 $ CALL DCOPY( MNMIN-1, BE, 1, WORK, 1 )
1074 CALL DBDSDC( UPLO, 'N', MNMIN, S2, WORK, DUM, 1, DUM, 1,
1075 $ DUM, IDUM, WORK( MNMIN+1 ), IWORK, IINFO )
1077 * Check error code from DBDSDC.
1079 IF( IINFO.NE.0 ) THEN
1080 WRITE( NOUT, FMT = 9998 )'DBDSDC(values)', IINFO, M, N,
1083 IF( IINFO.LT.0 ) THEN
1086 RESULT( 18 ) = ULPINV
1091 * Test 15: Check the decomposition B := U * S1 * VT
1092 * 16: Check the orthogonality of U
1093 * 17: Check the orthogonality of VT
1095 CALL DBDT03( UPLO, MNMIN, 1, BD, BE, U, LDPT, S1, VT, LDPT,
1096 $ WORK, RESULT( 15 ) )
1097 CALL DORT01( 'Columns', MNMIN, MNMIN, U, LDPT, WORK, LWORK,
1099 CALL DORT01( 'Rows', MNMIN, MNMIN, VT, LDPT, WORK, LWORK,
1102 * Test 18: Check that the singular values are sorted in
1103 * non-increasing order and are non-negative
1106 DO 150 I = 1, MNMIN - 1
1107 IF( S1( I ).LT.S1( I+1 ) )
1108 $ RESULT( 18 ) = ULPINV
1109 IF( S1( I ).LT.ZERO )
1110 $ RESULT( 18 ) = ULPINV
1112 IF( MNMIN.GE.1 ) THEN
1113 IF( S1( MNMIN ).LT.ZERO )
1114 $ RESULT( 18 ) = ULPINV
1117 * Test 19: Compare DBDSQR with and without singular vectors
1122 TEMP1 = ABS( S1( J )-S2( J ) ) /
1123 $ MAX( SQRT( UNFL )*MAX( S1( 1 ), ONE ),
1124 $ ULP*MAX( ABS( S1( 1 ) ), ABS( S2( 1 ) ) ) )
1125 TEMP2 = MAX( TEMP1, TEMP2 )
1128 RESULT( 19 ) = TEMP2
1131 * Use DBDSVDX to compute the SVD of the bidiagonal matrix B:
1134 IF( JTYPE.EQ.10 .OR. JTYPE.EQ.16 ) THEN
1135 * =================================
1136 * Matrix types temporarily disabled
1137 * =================================
1138 RESULT( 20:34 ) = ZERO
1146 IWWORK = IWBZ + 2*MNMIN*(MNMIN+1)
1147 MNMIN2 = MAX( 1,MNMIN*2 )
1149 CALL DCOPY( MNMIN, BD, 1, WORK( IWBD ), 1 )
1151 $ CALL DCOPY( MNMIN-1, BE, 1, WORK( IWBE ), 1 )
1153 CALL DBDSVDX( UPLO, 'V', 'A', MNMIN, WORK( IWBD ),
1154 $ WORK( IWBE ), ZERO, ZERO, 0, 0, NS1, S1,
1155 $ WORK( IWBZ ), MNMIN2, WORK( IWWORK ),
1158 * Check error code from DBDSVDX.
1160 IF( IINFO.NE.0 ) THEN
1161 WRITE( NOUT, FMT = 9998 )'DBDSVDX(vects,A)', IINFO, M, N,
1164 IF( IINFO.LT.0 ) THEN
1167 RESULT( 20 ) = ULPINV
1174 CALL DCOPY( MNMIN, WORK( J ), 1, U( 1,I ), 1 )
1176 CALL DCOPY( MNMIN, WORK( J ), 1, VT( I,1 ), LDPT )
1180 * Use DBDSVDX to compute only the singular values of the
1181 * bidiagonal matrix B; U and VT should not be modified.
1183 IF( JTYPE.EQ.9 ) THEN
1184 * =================================
1185 * Matrix types temporarily disabled
1186 * =================================
1191 CALL DCOPY( MNMIN, BD, 1, WORK( IWBD ), 1 )
1193 $ CALL DCOPY( MNMIN-1, BE, 1, WORK( IWBE ), 1 )
1195 CALL DBDSVDX( UPLO, 'N', 'A', MNMIN, WORK( IWBD ),
1196 $ WORK( IWBE ), ZERO, ZERO, 0, 0, NS2, S2,
1197 $ WORK( IWBZ ), MNMIN2, WORK( IWWORK ),
1200 * Check error code from DBDSVDX.
1202 IF( IINFO.NE.0 ) THEN
1203 WRITE( NOUT, FMT = 9998 )'DBDSVDX(values,A)', IINFO,
1204 $ M, N, JTYPE, IOLDSD
1206 IF( IINFO.LT.0 ) THEN
1209 RESULT( 24 ) = ULPINV
1214 * Save S1 for tests 30-34.
1216 CALL DCOPY( MNMIN, S1, 1, WORK( IWBS ), 1 )
1218 * Test 20: Check the decomposition B := U * S1 * VT
1219 * 21: Check the orthogonality of U
1220 * 22: Check the orthogonality of VT
1221 * 23: Check that the singular values are sorted in
1222 * non-increasing order and are non-negative
1223 * 24: Compare DBDSVDX with and without singular vectors
1225 CALL DBDT03( UPLO, MNMIN, 1, BD, BE, U, LDPT, S1, VT,
1226 $ LDPT, WORK( IWBS+MNMIN ), RESULT( 20 ) )
1227 CALL DORT01( 'Columns', MNMIN, MNMIN, U, LDPT,
1228 $ WORK( IWBS+MNMIN ), LWORK-MNMIN,
1230 CALL DORT01( 'Rows', MNMIN, MNMIN, VT, LDPT,
1231 $ WORK( IWBS+MNMIN ), LWORK-MNMIN,
1235 DO 180 I = 1, MNMIN - 1
1236 IF( S1( I ).LT.S1( I+1 ) )
1237 $ RESULT( 23 ) = ULPINV
1238 IF( S1( I ).LT.ZERO )
1239 $ RESULT( 23 ) = ULPINV
1241 IF( MNMIN.GE.1 ) THEN
1242 IF( S1( MNMIN ).LT.ZERO )
1243 $ RESULT( 23 ) = ULPINV
1248 TEMP1 = ABS( S1( J )-S2( J ) ) /
1249 $ MAX( SQRT( UNFL )*MAX( S1( 1 ), ONE ),
1250 $ ULP*MAX( ABS( S1( 1 ) ), ABS( S2( 1 ) ) ) )
1251 TEMP2 = MAX( TEMP1, TEMP2 )
1253 RESULT( 24 ) = TEMP2
1256 * Use DBDSVDX with RANGE='I': choose random values for IL and
1257 * IU, and ask for the IL-th through IU-th singular values
1258 * and corresponding vectors.
1261 ISEED2( I ) = ISEED( I )
1263 IF( MNMIN.LE.1 ) THEN
1267 IL = 1 + INT( ( MNMIN-1 )*DLARND( 1, ISEED2 ) )
1268 IU = 1 + INT( ( MNMIN-1 )*DLARND( 1, ISEED2 ) )
1276 CALL DCOPY( MNMIN, BD, 1, WORK( IWBD ), 1 )
1278 $ CALL DCOPY( MNMIN-1, BE, 1, WORK( IWBE ), 1 )
1280 CALL DBDSVDX( UPLO, 'V', 'I', MNMIN, WORK( IWBD ),
1281 $ WORK( IWBE ), ZERO, ZERO, IL, IU, NS1, S1,
1282 $ WORK( IWBZ ), MNMIN2, WORK( IWWORK ),
1285 * Check error code from DBDSVDX.
1287 IF( IINFO.NE.0 ) THEN
1288 WRITE( NOUT, FMT = 9998 )'DBDSVDX(vects,I)', IINFO,
1289 $ M, N, JTYPE, IOLDSD
1291 IF( IINFO.LT.0 ) THEN
1294 RESULT( 25 ) = ULPINV
1301 CALL DCOPY( MNMIN, WORK( J ), 1, U( 1,I ), 1 )
1303 CALL DCOPY( MNMIN, WORK( J ), 1, VT( I,1 ), LDPT )
1307 * Use DBDSVDX to compute only the singular values of the
1308 * bidiagonal matrix B; U and VT should not be modified.
1310 CALL DCOPY( MNMIN, BD, 1, WORK( IWBD ), 1 )
1312 $ CALL DCOPY( MNMIN-1, BE, 1, WORK( IWBE ), 1 )
1314 CALL DBDSVDX( UPLO, 'N', 'I', MNMIN, WORK( IWBD ),
1315 $ WORK( IWBE ), ZERO, ZERO, IL, IU, NS2, S2,
1316 $ WORK( IWBZ ), MNMIN2, WORK( IWWORK ),
1319 * Check error code from DBDSVDX.
1321 IF( IINFO.NE.0 ) THEN
1322 WRITE( NOUT, FMT = 9998 )'DBDSVDX(values,I)', IINFO,
1323 $ M, N, JTYPE, IOLDSD
1325 IF( IINFO.LT.0 ) THEN
1328 RESULT( 29 ) = ULPINV
1333 * Test 25: Check S1 - U' * B * VT'
1334 * 26: Check the orthogonality of U
1335 * 27: Check the orthogonality of VT
1336 * 28: Check that the singular values are sorted in
1337 * non-increasing order and are non-negative
1338 * 29: Compare DBDSVDX with and without singular vectors
1340 CALL DBDT04( UPLO, MNMIN, BD, BE, S1, NS1, U,
1341 $ LDPT, VT, LDPT, WORK( IWBS+MNMIN ),
1343 CALL DORT01( 'Columns', MNMIN, NS1, U, LDPT,
1344 $ WORK( IWBS+MNMIN ), LWORK-MNMIN,
1346 CALL DORT01( 'Rows', NS1, MNMIN, VT, LDPT,
1347 $ WORK( IWBS+MNMIN ), LWORK-MNMIN,
1351 DO 220 I = 1, NS1 - 1
1352 IF( S1( I ).LT.S1( I+1 ) )
1353 $ RESULT( 28 ) = ULPINV
1354 IF( S1( I ).LT.ZERO )
1355 $ RESULT( 28 ) = ULPINV
1358 IF( S1( NS1 ).LT.ZERO )
1359 $ RESULT( 28 ) = ULPINV
1364 TEMP1 = ABS( S1( J )-S2( J ) ) /
1365 $ MAX( SQRT( UNFL )*MAX( S1( 1 ), ONE ),
1366 $ ULP*MAX( ABS( S1( 1 ) ), ABS( S2( 1 ) ) ) )
1367 TEMP2 = MAX( TEMP1, TEMP2 )
1369 RESULT( 29 ) = TEMP2
1371 * Use DBDSVDX with RANGE='V': determine the values VL and VU
1372 * of the IL-th and IU-th singular values and ask for all
1373 * singular values in this range.
1375 CALL DCOPY( MNMIN, WORK( IWBS ), 1, S1, 1 )
1377 IF( MNMIN.GT.0 ) THEN
1379 VU = S1( IL ) + MAX( HALF*ABS( S1( IL )-S1( IL-1 ) ),
1380 $ ULP*ANORM, TWO*RTUNFL )
1382 VU = S1( 1 ) + MAX( HALF*ABS( S1( MNMIN )-S1( 1 ) ),
1383 $ ULP*ANORM, TWO*RTUNFL )
1385 IF( IU.NE.NS1 ) THEN
1386 VL = S1( IU ) - MAX( ULP*ANORM, TWO*RTUNFL,
1387 $ HALF*ABS( S1( IU+1 )-S1( IU ) ) )
1389 VL = S1( NS1 ) - MAX( ULP*ANORM, TWO*RTUNFL,
1390 $ HALF*ABS( S1( MNMIN )-S1( 1 ) ) )
1394 IF( VL.GE.VU ) VU = MAX( VU*2, VU+VL+HALF )
1400 CALL DCOPY( MNMIN, BD, 1, WORK( IWBD ), 1 )
1402 $ CALL DCOPY( MNMIN-1, BE, 1, WORK( IWBE ), 1 )
1404 CALL DBDSVDX( UPLO, 'V', 'V', MNMIN, WORK( IWBD ),
1405 $ WORK( IWBE ), VL, VU, 0, 0, NS1, S1,
1406 $ WORK( IWBZ ), MNMIN2, WORK( IWWORK ),
1409 * Check error code from DBDSVDX.
1411 IF( IINFO.NE.0 ) THEN
1412 WRITE( NOUT, FMT = 9998 )'DBDSVDX(vects,V)', IINFO,
1413 $ M, N, JTYPE, IOLDSD
1415 IF( IINFO.LT.0 ) THEN
1418 RESULT( 30 ) = ULPINV
1425 CALL DCOPY( MNMIN, WORK( J ), 1, U( 1,I ), 1 )
1427 CALL DCOPY( MNMIN, WORK( J ), 1, VT( I,1 ), LDPT )
1431 * Use DBDSVDX to compute only the singular values of the
1432 * bidiagonal matrix B; U and VT should not be modified.
1434 CALL DCOPY( MNMIN, BD, 1, WORK( IWBD ), 1 )
1436 $ CALL DCOPY( MNMIN-1, BE, 1, WORK( IWBE ), 1 )
1438 CALL DBDSVDX( UPLO, 'N', 'V', MNMIN, WORK( IWBD ),
1439 $ WORK( IWBE ), VL, VU, 0, 0, NS2, S2,
1440 $ WORK( IWBZ ), MNMIN2, WORK( IWWORK ),
1443 * Check error code from DBDSVDX.
1445 IF( IINFO.NE.0 ) THEN
1446 WRITE( NOUT, FMT = 9998 )'DBDSVDX(values,V)', IINFO,
1447 $ M, N, JTYPE, IOLDSD
1449 IF( IINFO.LT.0 ) THEN
1452 RESULT( 34 ) = ULPINV
1457 * Test 30: Check S1 - U' * B * VT'
1458 * 31: Check the orthogonality of U
1459 * 32: Check the orthogonality of VT
1460 * 33: Check that the singular values are sorted in
1461 * non-increasing order and are non-negative
1462 * 34: Compare DBDSVDX with and without singular vectors
1464 CALL DBDT04( UPLO, MNMIN, BD, BE, S1, NS1, U,
1465 $ LDPT, VT, LDPT, WORK( IWBS+MNMIN ),
1467 CALL DORT01( 'Columns', MNMIN, NS1, U, LDPT,
1468 $ WORK( IWBS+MNMIN ), LWORK-MNMIN,
1470 CALL DORT01( 'Rows', NS1, MNMIN, VT, LDPT,
1471 $ WORK( IWBS+MNMIN ), LWORK-MNMIN,
1475 DO 250 I = 1, NS1 - 1
1476 IF( S1( I ).LT.S1( I+1 ) )
1477 $ RESULT( 28 ) = ULPINV
1478 IF( S1( I ).LT.ZERO )
1479 $ RESULT( 28 ) = ULPINV
1482 IF( S1( NS1 ).LT.ZERO )
1483 $ RESULT( 28 ) = ULPINV
1488 TEMP1 = ABS( S1( J )-S2( J ) ) /
1489 $ MAX( SQRT( UNFL )*MAX( S1( 1 ), ONE ),
1490 $ ULP*MAX( ABS( S1( 1 ) ), ABS( S2( 1 ) ) ) )
1491 TEMP2 = MAX( TEMP1, TEMP2 )
1493 RESULT( 34 ) = TEMP2
1495 * End of Loop -- Check for RESULT(j) > THRESH
1500 IF( RESULT( J ).GE.THRESH ) THEN
1502 $ CALL DLAHD2( NOUT, PATH )
1503 WRITE( NOUT, FMT = 9999 )M, N, JTYPE, IOLDSD, J,
1508 IF( .NOT.BIDIAG ) THEN
1519 CALL ALASUM( PATH, NOUT, NFAIL, NTEST, 0 )
1525 9999 FORMAT( ' M=', I5, ', N=', I5, ', type ', I2, ', seed=',
1526 $ 4( I4, ',' ), ' test(', I2, ')=', G11.4 )
1527 9998 FORMAT( ' DCHKBD: ', A, ' returned INFO=', I6, '.', / 9X, 'M=',
1528 $ I6, ', N=', I6, ', JTYPE=', I6, ', ISEED=(', 3( I5, ',' ),