84 DOUBLE PRECISION ONE, ZERO
85 parameter( nmax = 4, one = 1.0d0, zero = 0.0d0 )
89 INTEGER I, IHI, ILO, INFO, J, NS, NT, SDIM
90 DOUBLE PRECISION ABNRM
95 DOUBLE PRECISION A( NMAX, NMAX ), R1( NMAX ), R2( NMAX ),
96 $ S( NMAX ), U( NMAX, NMAX ), VL( NMAX, NMAX ),
97 $ VR( NMAX, NMAX ), VT( NMAX, NMAX ),
98 $ W( 10*NMAX ), WI( NMAX ), WR( NMAX )
105 LOGICAL DSLECT, LSAMEN
106 EXTERNAL dslect, lsamen
113 DOUBLE PRECISION SELWI( 20 ), SELWR( 20 )
118 INTEGER INFOT, NOUT, SELDIM, SELOPT
121 COMMON / infoc / infot, nout, ok, lerr
122 COMMON / srnamc / srnamt
123 COMMON / sslct / selopt, seldim, selval, selwr, selwi
128 WRITE( nout, fmt = * )
144 IF( lsamen( 2, c2,
'EV' ) )
THEN
150 CALL dgeev(
'X',
'N', 0, a, 1, wr, wi, vl, 1, vr, 1, w, 1,
152 CALL chkxer(
'DGEEV ', infot, nout, lerr, ok )
154 CALL dgeev(
'N',
'X', 0, a, 1, wr, wi, vl, 1, vr, 1, w, 1,
156 CALL chkxer(
'DGEEV ', infot, nout, lerr, ok )
158 CALL dgeev(
'N',
'N', -1, a, 1, wr, wi, vl, 1, vr, 1, w, 1,
160 CALL chkxer(
'DGEEV ', infot, nout, lerr, ok )
162 CALL dgeev(
'N',
'N', 2, a, 1, wr, wi, vl, 1, vr, 1, w, 6,
164 CALL chkxer(
'DGEEV ', infot, nout, lerr, ok )
166 CALL dgeev(
'V',
'N', 2, a, 2, wr, wi, vl, 1, vr, 1, w, 8,
168 CALL chkxer(
'DGEEV ', infot, nout, lerr, ok )
170 CALL dgeev(
'N',
'V', 2, a, 2, wr, wi, vl, 1, vr, 1, w, 8,
172 CALL chkxer(
'DGEEV ', infot, nout, lerr, ok )
174 CALL dgeev(
'V',
'V', 1, a, 1, wr, wi, vl, 1, vr, 1, w, 3,
176 CALL chkxer(
'DGEEV ', infot, nout, lerr, ok )
179 ELSE IF( lsamen( 2, c2,
'ES' ) )
THEN
185 CALL dgees(
'X',
'N', dslect, 0, a, 1, sdim, wr, wi, vl, 1, w,
187 CALL chkxer(
'DGEES ', infot, nout, lerr, ok )
189 CALL dgees(
'N',
'X', dslect, 0, a, 1, sdim, wr, wi, vl, 1, w,
191 CALL chkxer(
'DGEES ', infot, nout, lerr, ok )
193 CALL dgees(
'N',
'S', dslect, -1, a, 1, sdim, wr, wi, vl, 1, w,
195 CALL chkxer(
'DGEES ', infot, nout, lerr, ok )
197 CALL dgees(
'N',
'S', dslect, 2, a, 1, sdim, wr, wi, vl, 1, w,
199 CALL chkxer(
'DGEES ', infot, nout, lerr, ok )
201 CALL dgees(
'V',
'S', dslect, 2, a, 2, sdim, wr, wi, vl, 1, w,
203 CALL chkxer(
'DGEES ', infot, nout, lerr, ok )
205 CALL dgees(
'N',
'S', dslect, 1, a, 1, sdim, wr, wi, vl, 1, w,
207 CALL chkxer(
'DGEES ', infot, nout, lerr, ok )
210 ELSE IF( lsamen( 2, c2,
'VX' ) )
THEN
216 CALL dgeevx(
'X',
'N',
'N',
'N', 0, a, 1, wr, wi, vl, 1, vr, 1,
217 $ ilo, ihi, s, abnrm, r1, r2, w, 1, iw, info )
218 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
220 CALL dgeevx(
'N',
'X',
'N',
'N', 0, a, 1, wr, wi, vl, 1, vr, 1,
221 $ ilo, ihi, s, abnrm, r1, r2, w, 1, iw, info )
222 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
224 CALL dgeevx(
'N',
'N',
'X',
'N', 0, a, 1, wr, wi, vl, 1, vr, 1,
225 $ ilo, ihi, s, abnrm, r1, r2, w, 1, iw, info )
226 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
228 CALL dgeevx(
'N',
'N',
'N',
'X', 0, a, 1, wr, wi, vl, 1, vr, 1,
229 $ ilo, ihi, s, abnrm, r1, r2, w, 1, iw, info )
230 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
232 CALL dgeevx(
'N',
'N',
'N',
'N', -1, a, 1, wr, wi, vl, 1, vr,
233 $ 1, ilo, ihi, s, abnrm, r1, r2, w, 1, iw, info )
234 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
236 CALL dgeevx(
'N',
'N',
'N',
'N', 2, a, 1, wr, wi, vl, 1, vr, 1,
237 $ ilo, ihi, s, abnrm, r1, r2, w, 1, iw, info )
238 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
240 CALL dgeevx(
'N',
'V',
'N',
'N', 2, a, 2, wr, wi, vl, 1, vr, 1,
241 $ ilo, ihi, s, abnrm, r1, r2, w, 6, iw, info )
242 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
244 CALL dgeevx(
'N',
'N',
'V',
'N', 2, a, 2, wr, wi, vl, 1, vr, 1,
245 $ ilo, ihi, s, abnrm, r1, r2, w, 6, iw, info )
246 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
248 CALL dgeevx(
'N',
'N',
'N',
'N', 1, a, 1, wr, wi, vl, 1, vr, 1,
249 $ ilo, ihi, s, abnrm, r1, r2, w, 1, iw, info )
250 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
252 CALL dgeevx(
'N',
'V',
'N',
'N', 1, a, 1, wr, wi, vl, 1, vr, 1,
253 $ ilo, ihi, s, abnrm, r1, r2, w, 2, iw, info )
254 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
256 CALL dgeevx(
'N',
'N',
'V',
'V', 1, a, 1, wr, wi, vl, 1, vr, 1,
257 $ ilo, ihi, s, abnrm, r1, r2, w, 3, iw, info )
258 CALL chkxer(
'DGEEVX', infot, nout, lerr, ok )
261 ELSE IF( lsamen( 2, c2,
'SX' ) )
THEN
267 CALL dgeesx(
'X',
'N', dslect,
'N', 0, a, 1, sdim, wr, wi, vl,
268 $ 1, r1( 1 ), r2( 1 ), w, 1, iw, 1, b, info )
269 CALL chkxer(
'DGEESX', infot, nout, lerr, ok )
271 CALL dgeesx(
'N',
'X', dslect,
'N', 0, a, 1, sdim, wr, wi, vl,
272 $ 1, r1( 1 ), r2( 1 ), w, 1, iw, 1, b, info )
273 CALL chkxer(
'DGEESX', infot, nout, lerr, ok )
275 CALL dgeesx(
'N',
'N', dslect,
'X', 0, a, 1, sdim, wr, wi, vl,
276 $ 1, r1( 1 ), r2( 1 ), w, 1, iw, 1, b, info )
277 CALL chkxer(
'DGEESX', infot, nout, lerr, ok )
279 CALL dgeesx(
'N',
'N', dslect,
'N', -1, a, 1, sdim, wr, wi, vl,
280 $ 1, r1( 1 ), r2( 1 ), w, 1, iw, 1, b, info )
281 CALL chkxer(
'DGEESX', infot, nout, lerr, ok )
283 CALL dgeesx(
'N',
'N', dslect,
'N', 2, a, 1, sdim, wr, wi, vl,
284 $ 1, r1( 1 ), r2( 1 ), w, 6, iw, 1, b, info )
285 CALL chkxer(
'DGEESX', infot, nout, lerr, ok )
287 CALL dgeesx(
'V',
'N', dslect,
'N', 2, a, 2, sdim, wr, wi, vl,
288 $ 1, r1( 1 ), r2( 1 ), w, 6, iw, 1, b, info )
289 CALL chkxer(
'DGEESX', infot, nout, lerr, ok )
291 CALL dgeesx(
'N',
'N', dslect,
'N', 1, a, 1, sdim, wr, wi, vl,
292 $ 1, r1( 1 ), r2( 1 ), w, 2, iw, 1, b, info )
293 CALL chkxer(
'DGEESX', infot, nout, lerr, ok )
296 ELSE IF( lsamen( 2, c2,
'BD' ) )
THEN
302 CALL dgesvd(
'X',
'N', 0, 0, a, 1, s, u, 1, vt, 1, w, 1, info )
303 CALL chkxer(
'DGESVD', infot, nout, lerr, ok )
305 CALL dgesvd(
'N',
'X', 0, 0, a, 1, s, u, 1, vt, 1, w, 1, info )
306 CALL chkxer(
'DGESVD', infot, nout, lerr, ok )
308 CALL dgesvd(
'O',
'O', 0, 0, a, 1, s, u, 1, vt, 1, w, 1, info )
309 CALL chkxer(
'DGESVD', infot, nout, lerr, ok )
311 CALL dgesvd(
'N',
'N', -1, 0, a, 1, s, u, 1, vt, 1, w, 1,
313 CALL chkxer(
'DGESVD', infot, nout, lerr, ok )
315 CALL dgesvd(
'N',
'N', 0, -1, a, 1, s, u, 1, vt, 1, w, 1,
317 CALL chkxer(
'DGESVD', infot, nout, lerr, ok )
319 CALL dgesvd(
'N',
'N', 2, 1, a, 1, s, u, 1, vt, 1, w, 5, info )
320 CALL chkxer(
'DGESVD', infot, nout, lerr, ok )
322 CALL dgesvd(
'A',
'N', 2, 1, a, 2, s, u, 1, vt, 1, w, 5, info )
323 CALL chkxer(
'DGESVD', infot, nout, lerr, ok )
325 CALL dgesvd(
'N',
'A', 1, 2, a, 1, s, u, 1, vt, 1, w, 5, info )
326 CALL chkxer(
'DGESVD', infot, nout, lerr, ok )
329 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
332 WRITE( nout, fmt = 9998 )
339 CALL dgesdd(
'X', 0, 0, a, 1, s, u, 1, vt, 1, w, 1, iw, info )
340 CALL chkxer(
'DGESDD', infot, nout, lerr, ok )
342 CALL dgesdd(
'N', -1, 0, a, 1, s, u, 1, vt, 1, w, 1, iw, info )
343 CALL chkxer(
'DGESDD', infot, nout, lerr, ok )
345 CALL dgesdd(
'N', 0, -1, a, 1, s, u, 1, vt, 1, w, 1, iw, info )
346 CALL chkxer(
'DGESDD', infot, nout, lerr, ok )
348 CALL dgesdd(
'N', 2, 1, a, 1, s, u, 1, vt, 1, w, 5, iw, info )
349 CALL chkxer(
'DGESDD', infot, nout, lerr, ok )
351 CALL dgesdd(
'A', 2, 1, a, 2, s, u, 1, vt, 1, w, 5, iw, info )
352 CALL chkxer(
'DGESDD', infot, nout, lerr, ok )
354 CALL dgesdd(
'A', 1, 2, a, 1, s, u, 1, vt, 1, w, 5, iw, info )
355 CALL chkxer(
'DGESDD', infot, nout, lerr, ok )
358 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
361 WRITE( nout, fmt = 9998 )
368 CALL dgejsv(
'X',
'U',
'V',
'R',
'N',
'N',
369 $ 0, 0, a, 1, s, u, 1, vt, 1,
371 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
373 CALL dgejsv(
'G',
'X',
'V',
'R',
'N',
'N',
374 $ 0, 0, a, 1, s, u, 1, vt, 1,
376 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
378 CALL dgejsv(
'G',
'U',
'X',
'R',
'N',
'N',
379 $ 0, 0, a, 1, s, u, 1, vt, 1,
381 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
383 CALL dgejsv(
'G',
'U',
'V',
'X',
'N',
'N',
384 $ 0, 0, a, 1, s, u, 1, vt, 1,
386 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
388 CALL dgejsv(
'G',
'U',
'V',
'R',
'X',
'N',
389 $ 0, 0, a, 1, s, u, 1, vt, 1,
391 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
393 CALL dgejsv(
'G',
'U',
'V',
'R',
'N',
'X',
394 $ 0, 0, a, 1, s, u, 1, vt, 1,
396 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
398 CALL dgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
399 $ -1, 0, a, 1, s, u, 1, vt, 1,
401 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
403 CALL dgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
404 $ 0, -1, a, 1, s, u, 1, vt, 1,
406 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
408 CALL dgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
409 $ 2, 1, a, 1, s, u, 1, vt, 1,
411 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
413 CALL dgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
414 $ 2, 2, a, 2, s, u, 1, vt, 2,
416 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
418 CALL dgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
419 $ 2, 2, a, 2, s, u, 2, vt, 1,
421 CALL chkxer(
'DGEJSV', infot, nout, lerr, ok )
424 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
427 WRITE( nout, fmt = 9998 )
434 CALL dgesvdx(
'X',
'N',
'A', 0, 0, a, 1, zero, zero,
435 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
436 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
438 CALL dgesvdx(
'N',
'X',
'A', 0, 0, a, 1, zero, zero,
439 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
440 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
442 CALL dgesvdx(
'N',
'N',
'X', 0, 0, a, 1, zero, zero,
443 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
444 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
446 CALL dgesvdx(
'N',
'N',
'A', -1, 0, a, 1, zero, zero,
447 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
448 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
450 CALL dgesvdx(
'N',
'N',
'A', 0, -1, a, 1, zero, zero,
451 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
452 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
454 CALL dgesvdx(
'N',
'N',
'A', 2, 1, a, 1, zero, zero,
455 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
456 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
458 CALL dgesvdx(
'N',
'N',
'V', 2, 1, a, 2, -one, zero,
459 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
460 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
462 CALL dgesvdx(
'N',
'N',
'V', 2, 1, a, 2, one, zero,
463 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
464 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
466 CALL dgesvdx(
'N',
'N',
'I', 2, 2, a, 2, zero, zero,
467 $ 0, 1, ns, s, u, 1, vt, 1, w, 1, iw, info )
468 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
470 CALL dgesvdx(
'V',
'N',
'I', 2, 2, a, 2, zero, zero,
471 $ 1, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
472 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
474 CALL dgesvdx(
'V',
'N',
'A', 2, 2, a, 2, zero, zero,
475 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
476 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
478 CALL dgesvdx(
'N',
'V',
'A', 2, 2, a, 2, zero, zero,
479 $ 0, 0, ns, s, u, 1, vt, 1, w, 1, iw, info )
480 CALL chkxer(
'DGESVDX', infot, nout, lerr, ok )
483 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
486 WRITE( nout, fmt = 9998 )
493 CALL dgesvdq(
'X',
'P',
'T',
'A',
'A', 0, 0, a, 1, s, u,
494 $ 0, vt, 0, ns, iw, 1, w, 1, w, 1, info )
495 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
497 CALL dgesvdq(
'A',
'X',
'T',
'A',
'A', 0, 0, a, 1, s, u,
498 $ 0, vt, 0, ns, iw, 1, w, 1, w, 1, info )
499 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
501 CALL dgesvdq(
'A',
'P',
'X',
'A',
'A', 0, 0, a, 1, s, u,
502 $ 0, vt, 0, ns, iw, 1, w, 1, w, 1, info )
503 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
505 CALL dgesvdq(
'A',
'P',
'T',
'X',
'A', 0, 0, a, 1, s, u,
506 $ 0, vt, 0, ns, iw, 1, w, 1, w, 1, info )
507 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
509 CALL dgesvdq(
'A',
'P',
'T',
'A',
'X', 0, 0, a, 1, s, u,
510 $ 0, vt, 0, ns, iw, 1, w, 1, w, 1, info )
511 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
513 CALL dgesvdq(
'A',
'P',
'T',
'A',
'A', -1, 0, a, 1, s, u,
514 $ 0, vt, 0, ns, iw, 1, w, 1, w, 1, info )
515 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
517 CALL dgesvdq(
'A',
'P',
'T',
'A',
'A', 0, 1, a, 1, s, u,
518 $ 0, vt, 0, ns, iw, 1, w, 1, w, 1, info )
519 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
521 CALL dgesvdq(
'A',
'P',
'T',
'A',
'A', 1, 1, a, 0, s, u,
522 $ 0, vt, 0, ns, iw, 1, w, 1, w, 1, info )
523 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
525 CALL dgesvdq(
'A',
'P',
'T',
'A',
'A', 1, 1, a, 1, s, u,
526 $ -1, vt, 0, ns, iw, 1, w, 1, w, 1, info )
527 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
529 CALL dgesvdq(
'A',
'P',
'T',
'A',
'A', 1, 1, a, 1, s, u,
530 $ 1, vt, -1, ns, iw, 1, w, 1, w, 1, info )
531 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
533 CALL dgesvdq(
'A',
'P',
'T',
'A',
'A', 1, 1, a, 1, s, u,
534 $ 1, vt, 1, ns, iw, -5, w, 1, w, 1, info )
535 CALL chkxer(
'DGESVDQ', infot, nout, lerr, ok )
538 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
541 WRITE( nout, fmt = 9998 )
547 IF( .NOT.lsamen( 2, c2,
'BD' ) )
THEN
549 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
552 WRITE( nout, fmt = 9998 )
556 9999
FORMAT( 1x, a,
' passed the tests of the error exits (', i3,
558 9998
FORMAT(
' *** ', a,
' failed the tests of the error exits ***' )
subroutine chkxer(srnamt, infot, nout, lerr, ok)
subroutine derred(path, nunit)
DERRED
subroutine dgees(jobvs, sort, select, n, a, lda, sdim, wr, wi, vs, ldvs, work, lwork, bwork, info)
DGEES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE m...
subroutine dgeesx(jobvs, sort, select, sense, n, a, lda, sdim, wr, wi, vs, ldvs, rconde, rcondv, work, lwork, iwork, liwork, bwork, info)
DGEESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE ...
subroutine dgeev(jobvl, jobvr, n, a, lda, wr, wi, vl, ldvl, vr, ldvr, work, lwork, info)
DGEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices
subroutine dgeevx(balanc, jobvl, jobvr, sense, n, a, lda, wr, wi, vl, ldvl, vr, ldvr, ilo, ihi, scale, abnrm, rconde, rcondv, work, lwork, iwork, info)
DGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices
subroutine dgejsv(joba, jobu, jobv, jobr, jobt, jobp, m, n, a, lda, sva, u, ldu, v, ldv, work, lwork, iwork, info)
DGEJSV
subroutine dgesdd(jobz, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, iwork, info)
DGESDD
subroutine dgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, info)
DGESVD computes the singular value decomposition (SVD) for GE matrices
subroutine dgesvdq(joba, jobp, jobr, jobu, jobv, m, n, a, lda, s, u, ldu, v, ldv, numrank, iwork, liwork, work, lwork, rwork, lrwork, info)
DGESVDQ computes the singular value decomposition (SVD) with a QR-Preconditioned QR SVD Method for GE...
subroutine dgesvdx(jobu, jobvt, range, m, n, a, lda, vl, vu, il, iu, ns, s, u, ldu, vt, ldvt, work, lwork, iwork, info)
DGESVDX computes the singular value decomposition (SVD) for GE matrices