85 parameter( nmax = 4, one = 1.0e0, zero = 0.0e0 )
89 INTEGER I, IHI, ILO, INFO, J, NS, NT, SDIM
95 REAL 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 SSLECT, LSAMEN
106 EXTERNAL sslect, lsamen
113 REAL 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 sgeev(
'X',
'N', 0, a, 1, wr, wi, vl, 1, vr, 1, w, 1,
152 CALL chkxer(
'SGEEV ', infot, nout, lerr, ok )
154 CALL sgeev(
'N',
'X', 0, a, 1, wr, wi, vl, 1, vr, 1, w, 1,
156 CALL chkxer(
'SGEEV ', infot, nout, lerr, ok )
158 CALL sgeev(
'N',
'N', -1, a, 1, wr, wi, vl, 1, vr, 1, w, 1,
160 CALL chkxer(
'SGEEV ', infot, nout, lerr, ok )
162 CALL sgeev(
'N',
'N', 2, a, 1, wr, wi, vl, 1, vr, 1, w, 6,
164 CALL chkxer(
'SGEEV ', infot, nout, lerr, ok )
166 CALL sgeev(
'V',
'N', 2, a, 2, wr, wi, vl, 1, vr, 1, w, 8,
168 CALL chkxer(
'SGEEV ', infot, nout, lerr, ok )
170 CALL sgeev(
'N',
'V', 2, a, 2, wr, wi, vl, 1, vr, 1, w, 8,
172 CALL chkxer(
'SGEEV ', infot, nout, lerr, ok )
174 CALL sgeev(
'V',
'V', 1, a, 1, wr, wi, vl, 1, vr, 1, w, 3,
176 CALL chkxer(
'SGEEV ', infot, nout, lerr, ok )
179 ELSE IF( lsamen( 2, c2,
'ES' ) )
THEN
185 CALL sgees(
'X',
'N', sslect, 0, a, 1, sdim, wr, wi, vl, 1, w,
187 CALL chkxer(
'SGEES ', infot, nout, lerr, ok )
189 CALL sgees(
'N',
'X', sslect, 0, a, 1, sdim, wr, wi, vl, 1, w,
191 CALL chkxer(
'SGEES ', infot, nout, lerr, ok )
193 CALL sgees(
'N',
'S', sslect, -1, a, 1, sdim, wr, wi, vl, 1, w,
195 CALL chkxer(
'SGEES ', infot, nout, lerr, ok )
197 CALL sgees(
'N',
'S', sslect, 2, a, 1, sdim, wr, wi, vl, 1, w,
199 CALL chkxer(
'SGEES ', infot, nout, lerr, ok )
201 CALL sgees(
'V',
'S', sslect, 2, a, 2, sdim, wr, wi, vl, 1, w,
203 CALL chkxer(
'SGEES ', infot, nout, lerr, ok )
205 CALL sgees(
'N',
'S', sslect, 1, a, 1, sdim, wr, wi, vl, 1, w,
207 CALL chkxer(
'SGEES ', infot, nout, lerr, ok )
210 ELSE IF( lsamen( 2, c2,
'VX' ) )
THEN
216 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
220 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
224 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
228 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
232 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
236 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
240 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
244 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
248 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
252 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
256 CALL sgeevx(
'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(
'SGEEVX', infot, nout, lerr, ok )
261 ELSE IF( lsamen( 2, c2,
'SX' ) )
THEN
267 CALL sgeesx(
'X',
'N', sslect,
'N', 0, a, 1, sdim, wr, wi, vl,
268 $ 1, r1( 1 ), r2( 1 ), w, 1, iw, 1, b, info )
269 CALL chkxer(
'SGEESX', infot, nout, lerr, ok )
271 CALL sgeesx(
'N',
'X', sslect,
'N', 0, a, 1, sdim, wr, wi, vl,
272 $ 1, r1( 1 ), r2( 1 ), w, 1, iw, 1, b, info )
273 CALL chkxer(
'SGEESX', infot, nout, lerr, ok )
275 CALL sgeesx(
'N',
'N', sslect,
'X', 0, a, 1, sdim, wr, wi, vl,
276 $ 1, r1( 1 ), r2( 1 ), w, 1, iw, 1, b, info )
277 CALL chkxer(
'SGEESX', infot, nout, lerr, ok )
279 CALL sgeesx(
'N',
'N', sslect,
'N', -1, a, 1, sdim, wr, wi, vl,
280 $ 1, r1( 1 ), r2( 1 ), w, 1, iw, 1, b, info )
281 CALL chkxer(
'SGEESX', infot, nout, lerr, ok )
283 CALL sgeesx(
'N',
'N', sslect,
'N', 2, a, 1, sdim, wr, wi, vl,
284 $ 1, r1( 1 ), r2( 1 ), w, 6, iw, 1, b, info )
285 CALL chkxer(
'SGEESX', infot, nout, lerr, ok )
287 CALL sgeesx(
'V',
'N', sslect,
'N', 2, a, 2, sdim, wr, wi, vl,
288 $ 1, r1( 1 ), r2( 1 ), w, 6, iw, 1, b, info )
289 CALL chkxer(
'SGEESX', infot, nout, lerr, ok )
291 CALL sgeesx(
'N',
'N', sslect,
'N', 1, a, 1, sdim, wr, wi, vl,
292 $ 1, r1( 1 ), r2( 1 ), w, 2, iw, 1, b, info )
293 CALL chkxer(
'SGEESX', infot, nout, lerr, ok )
296 ELSE IF( lsamen( 2, c2,
'BD' ) )
THEN
302 CALL sgesvd(
'X',
'N', 0, 0, a, 1, s, u, 1, vt, 1, w, 1, info )
303 CALL chkxer(
'SGESVD', infot, nout, lerr, ok )
305 CALL sgesvd(
'N',
'X', 0, 0, a, 1, s, u, 1, vt, 1, w, 1, info )
306 CALL chkxer(
'SGESVD', infot, nout, lerr, ok )
308 CALL sgesvd(
'O',
'O', 0, 0, a, 1, s, u, 1, vt, 1, w, 1, info )
309 CALL chkxer(
'SGESVD', infot, nout, lerr, ok )
311 CALL sgesvd(
'N',
'N', -1, 0, a, 1, s, u, 1, vt, 1, w, 1,
313 CALL chkxer(
'SGESVD', infot, nout, lerr, ok )
315 CALL sgesvd(
'N',
'N', 0, -1, a, 1, s, u, 1, vt, 1, w, 1,
317 CALL chkxer(
'SGESVD', infot, nout, lerr, ok )
319 CALL sgesvd(
'N',
'N', 2, 1, a, 1, s, u, 1, vt, 1, w, 5, info )
320 CALL chkxer(
'SGESVD', infot, nout, lerr, ok )
322 CALL sgesvd(
'A',
'N', 2, 1, a, 2, s, u, 1, vt, 1, w, 5, info )
323 CALL chkxer(
'SGESVD', infot, nout, lerr, ok )
325 CALL sgesvd(
'N',
'A', 1, 2, a, 1, s, u, 1, vt, 1, w, 5, info )
326 CALL chkxer(
'SGESVD', infot, nout, lerr, ok )
329 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
332 WRITE( nout, fmt = 9998 )
339 CALL sgesdd(
'X', 0, 0, a, 1, s, u, 1, vt, 1, w, 1, iw, info )
340 CALL chkxer(
'SGESDD', infot, nout, lerr, ok )
342 CALL sgesdd(
'N', -1, 0, a, 1, s, u, 1, vt, 1, w, 1, iw, info )
343 CALL chkxer(
'SGESDD', infot, nout, lerr, ok )
345 CALL sgesdd(
'N', 0, -1, a, 1, s, u, 1, vt, 1, w, 1, iw, info )
346 CALL chkxer(
'SGESDD', infot, nout, lerr, ok )
348 CALL sgesdd(
'N', 2, 1, a, 1, s, u, 1, vt, 1, w, 5, iw, info )
349 CALL chkxer(
'SGESDD', infot, nout, lerr, ok )
351 CALL sgesdd(
'A', 2, 1, a, 2, s, u, 1, vt, 1, w, 5, iw, info )
352 CALL chkxer(
'SGESDD', infot, nout, lerr, ok )
354 CALL sgesdd(
'A', 1, 2, a, 1, s, u, 1, vt, 1, w, 5, iw, info )
355 CALL chkxer(
'SGESDD', infot, nout, lerr, ok )
358 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
361 WRITE( nout, fmt = 9998 )
368 CALL sgejsv(
'X',
'U',
'V',
'R',
'N',
'N',
369 $ 0, 0, a, 1, s, u, 1, vt, 1,
371 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
373 CALL sgejsv(
'G',
'X',
'V',
'R',
'N',
'N',
374 $ 0, 0, a, 1, s, u, 1, vt, 1,
376 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
378 CALL sgejsv(
'G',
'U',
'X',
'R',
'N',
'N',
379 $ 0, 0, a, 1, s, u, 1, vt, 1,
381 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
383 CALL sgejsv(
'G',
'U',
'V',
'X',
'N',
'N',
384 $ 0, 0, a, 1, s, u, 1, vt, 1,
386 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
388 CALL sgejsv(
'G',
'U',
'V',
'R',
'X',
'N',
389 $ 0, 0, a, 1, s, u, 1, vt, 1,
391 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
393 CALL sgejsv(
'G',
'U',
'V',
'R',
'N',
'X',
394 $ 0, 0, a, 1, s, u, 1, vt, 1,
396 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
398 CALL sgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
399 $ -1, 0, a, 1, s, u, 1, vt, 1,
401 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
403 CALL sgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
404 $ 0, -1, a, 1, s, u, 1, vt, 1,
406 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
408 CALL sgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
409 $ 2, 1, a, 1, s, u, 1, vt, 1,
411 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
413 CALL sgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
414 $ 2, 2, a, 2, s, u, 1, vt, 2,
416 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
418 CALL sgejsv(
'G',
'U',
'V',
'R',
'N',
'N',
419 $ 2, 2, a, 2, s, u, 2, vt, 1,
421 CALL chkxer(
'SGEJSV', infot, nout, lerr, ok )
424 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
427 WRITE( nout, fmt = 9998 )
434 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
438 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
442 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
446 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
450 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
454 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
458 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
462 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
466 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
470 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
474 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
478 CALL sgesvdx(
'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(
'SGESVDX', infot, nout, lerr, ok )
483 WRITE( nout, fmt = 9999 )srnamt( 1:len_trim( srnamt ) ),
486 WRITE( nout, fmt = 9998 )
493 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
497 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
501 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
505 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
509 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
513 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
517 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
521 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
525 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
529 CALL sgesvdq(
'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(
'SGESVDQ', infot, nout, lerr, ok )
533 CALL sgesvdq(
'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(
'SGESVDQ', 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 sgees(jobvs, sort, select, n, a, lda, sdim, wr, wi, vs, ldvs, work, lwork, bwork, info)
SGEES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE m...
subroutine sgeesx(jobvs, sort, select, sense, n, a, lda, sdim, wr, wi, vs, ldvs, rconde, rcondv, work, lwork, iwork, liwork, bwork, info)
SGEESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE ...
subroutine sgeev(jobvl, jobvr, n, a, lda, wr, wi, vl, ldvl, vr, ldvr, work, lwork, info)
SGEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices
subroutine sgeevx(balanc, jobvl, jobvr, sense, n, a, lda, wr, wi, vl, ldvl, vr, ldvr, ilo, ihi, scale, abnrm, rconde, rcondv, work, lwork, iwork, info)
SGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices
subroutine sgejsv(joba, jobu, jobv, jobr, jobt, jobp, m, n, a, lda, sva, u, ldu, v, ldv, work, lwork, iwork, info)
SGEJSV
subroutine sgesdd(jobz, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, iwork, info)
SGESDD
subroutine sgesvd(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, info)
SGESVD computes the singular value decomposition (SVD) for GE matrices
subroutine sgesvdq(joba, jobp, jobr, jobu, jobv, m, n, a, lda, s, u, ldu, v, ldv, numrank, iwork, liwork, work, lwork, rwork, lrwork, info)
SGESVDQ computes the singular value decomposition (SVD) with a QR-Preconditioned QR SVD Method for GE...
subroutine sgesvdx(jobu, jobvt, range, m, n, a, lda, vl, vu, il, iu, ns, s, u, ldu, vt, ldvt, work, lwork, iwork, info)
SGESVDX computes the singular value decomposition (SVD) for GE matrices
subroutine serred(path, nunit)
SERRED