dslect.c
Go to the documentation of this file.
00001 /* dslect.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Common Block Declarations */
00017 
00018 struct {
00019     integer selopt, seldim;
00020     logical selval[20];
00021     doublereal selwr[20], selwi[20];
00022 } sslct_;
00023 
00024 #define sslct_1 sslct_
00025 
00026 logical dslect_(doublereal *zr, doublereal *zi)
00027 {
00028     /* System generated locals */
00029     integer i__1;
00030     doublereal d__1, d__2;
00031     logical ret_val;
00032 
00033     /* Local variables */
00034     integer i__;
00035     doublereal x, rmin;
00036     extern doublereal dlapy2_(doublereal *, doublereal *);
00037 
00038 
00039 /*  -- LAPACK test routine (version 3.1.1) -- */
00040 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00041 /*     February 2007 */
00042 
00043 /*     .. Scalar Arguments .. */
00044 /*     .. */
00045 
00046 /*  Purpose */
00047 /*  ======= */
00048 
00049 /*  DSLECT returns .TRUE. if the eigenvalue ZR+sqrt(-1)*ZI is to be */
00050 /*  selected, and otherwise it returns .FALSE. */
00051 /*  It is used by DCHK41 to test if DGEES succesfully sorts eigenvalues, */
00052 /*  and by DCHK43 to test if DGEESX succesfully sorts eigenvalues. */
00053 
00054 /*  The common block /SSLCT/ controls how eigenvalues are selected. */
00055 /*  If SELOPT = 0, then DSLECT return .TRUE. when ZR is less than zero, */
00056 /*  and .FALSE. otherwise. */
00057 /*  If SELOPT is at least 1, DSLECT returns SELVAL(SELOPT) and adds 1 */
00058 /*  to SELOPT, cycling back to 1 at SELMAX. */
00059 
00060 /*  Arguments */
00061 /*  ========= */
00062 
00063 /*  ZR      (input) DOUBLE PRECISION */
00064 /*          The real part of a complex eigenvalue ZR + i*ZI. */
00065 
00066 /*  ZI      (input) DOUBLE PRECISION */
00067 /*          The imaginary part of a complex eigenvalue ZR + i*ZI. */
00068 
00069 /*  ===================================================================== */
00070 
00071 /*     .. Arrays in Common .. */
00072 /*     .. */
00073 /*     .. Scalars in Common .. */
00074 /*     .. */
00075 /*     .. Common blocks .. */
00076 /*     .. */
00077 /*     .. Local Scalars .. */
00078 /*     .. */
00079 /*     .. Parameters .. */
00080 /*     .. */
00081 /*     .. External Functions .. */
00082 /*     .. */
00083 /*     .. Executable Statements .. */
00084 
00085     if (sslct_1.selopt == 0) {
00086         ret_val = *zr < 0.;
00087     } else {
00088         d__1 = *zr - sslct_1.selwr[0];
00089         d__2 = *zi - sslct_1.selwi[0];
00090         rmin = dlapy2_(&d__1, &d__2);
00091         ret_val = sslct_1.selval[0];
00092         i__1 = sslct_1.seldim;
00093         for (i__ = 2; i__ <= i__1; ++i__) {
00094             d__1 = *zr - sslct_1.selwr[i__ - 1];
00095             d__2 = *zi - sslct_1.selwi[i__ - 1];
00096             x = dlapy2_(&d__1, &d__2);
00097             if (x <= rmin) {
00098                 rmin = x;
00099                 ret_val = sslct_1.selval[i__ - 1];
00100             }
00101 /* L10: */
00102         }
00103     }
00104     return ret_val;
00105 
00106 /*     End of DSLECT */
00107 
00108 } /* dslect_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:48