File: dlaeig.c

package info (click to toggle)
insighttoolkit 3.20.1%2Bgit20120521-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 80,672 kB
  • ctags: 85,253
  • sloc: cpp: 458,133; ansic: 196,222; fortran: 28,000; python: 3,839; tcl: 1,811; sh: 1,184; java: 583; makefile: 428; csh: 220; perl: 193; xml: 20
file content (142 lines) | stat: -rw-r--r-- 3,805 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/* laso/dlaeig.f -- translated by f2c (version 20050501).
   You must link the resulting object file with libf2c:
        on Microsoft Windows system, link with libf2c.lib;
        on Linux or Unix systems, link with .../path/to/libf2c.a -lm
        or, if you install libf2c.a in a standard place, with -lf2c -lm
        -- in that order, at the end of the command line, as in
                cc *.o -lf2c -lm
        Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,

                http://www.netlib.org/f2c/libf2c.zip
*/

#ifdef __cplusplus
extern "C" {
#endif
#include "v3p_netlib.h"



/*<    >*/
/* Subroutine */ int dlaeig_(integer *n, integer *nband, integer *nl, integer 
        *nr, doublereal *a, doublereal *eigval, integer *lde, doublereal *
        eigvec, doublereal *bound, doublereal *atemp, doublereal *d__, 
        doublereal *vtemp, doublereal *eps, doublereal *tmin, doublereal *
        tmax)
{
    /* System generated locals */
    integer a_dim1, a_offset, eigvec_dim1, eigvec_offset, i__1;
    doublereal d__1, d__2;

    /* Builtin functions */
    double sqrt(doublereal);

    /* Local variables */
    integer i__, m;
    doublereal atol;
    integer nval;
    doublereal artol;
    extern /* Subroutine */ int dlabcm_(integer *, integer *, integer *, 
            integer *, doublereal *, doublereal *, integer *, doublereal *, 
            doublereal *, doublereal *, doublereal *, doublereal *, 
            doublereal *, doublereal *);


/*  THIS IS A SPECIALIZED VERSION OF THE SUBROUTINE BNDEIG TAILORED */
/*  SPECIFICALLY FOR USE BY THE LASO PACKAGE. */

/*<       INTEGER N, NBAND, NL, NR, LDE >*/
/*<    >*/

/*  LOCAL VARIABLES */

/*<       INTEGER I, M, NVAL >*/
/*<       DOUBLE PRECISION ARTOL, ATOL >*/

/*  FUNCTIONS CALLED */

/*<       DOUBLE PRECISION DMAX1 >*/

/*  SUBROUTINES CALLED */

/*     DLABCM, DLABFC, DLAGER, DCOPY */

/*  SET PARAMETERS */

/*<       ATOL = DBLE(FLOAT(N))*EPS*DMAX1(TMAX,-TMIN) >*/
    /* Parameter adjustments */
    a_dim1 = *nband;
    a_offset = 1 + a_dim1;
    a -= a_offset;
    --eigval;
    eigvec_dim1 = *lde;
    eigvec_offset = 1 + eigvec_dim1;
    eigvec -= eigvec_offset;
    bound -= 3;
    --atemp;
    --d__;
    --vtemp;

    /* Function Body */
/* Computing MAX */
    d__1 = *tmax, d__2 = -(*tmin);
    atol = (doublereal) ((real) (*n)) * *eps * max(d__1,d__2);
/*<       ARTOL = ATOL/DSQRT(EPS) >*/
    artol = atol / sqrt(*eps);
/*<       NVAL = NR - NL + 1 >*/
    nval = *nr - *nl + 1;

/*   CHECK FOR SPECIAL CASE OF N = 1 */

/*<       IF(N .NE. 1) GO TO 30 >*/
    if (*n != 1) {
        goto L30;
    }
/*<       EIGVAL(1) = A(1,1) >*/
    eigval[1] = a[a_dim1 + 1];
/*<       EIGVEC(1,1) = 1.0D0 >*/
    eigvec[eigvec_dim1 + 1] = 1.;
/*<       RETURN >*/
    return 0;

/*   SET UP INITIAL EIGENVALUE BOUNDS */

/*<    30 M = NVAL + 1 >*/
L30:
    m = nval + 1;
/*<       DO 50 I = 2, M >*/
    i__1 = m;
    for (i__ = 2; i__ <= i__1; ++i__) {
/*<          BOUND(1,I) = TMIN >*/
        bound[(i__ << 1) + 1] = *tmin;
/*<          BOUND(2,I) = TMAX >*/
        bound[(i__ << 1) + 2] = *tmax;
/*<    50 CONTINUE >*/
/* L50: */
    }
/*<       BOUND(2,1) = TMAX >*/
    bound[4] = *tmax;
/*<       BOUND(1,NVAL + 2) = TMIN >*/
    bound[((nval + 2) << 1) + 1] = *tmin;
/*<       IF(NL .EQ. 1) BOUND(2,1) = TMIN >*/
    if (*nl == 1) {
        bound[4] = *tmin;
    }
/*<       IF(NR .EQ. N) BOUND(1,NVAL + 2) = TMAX >*/
    if (*nr == *n) {
        bound[((nval + 2) << 1) + 1] = *tmax;
    }

/*<    >*/
/* L60: */
    dlabcm_(n, nband, nl, nr, &a[a_offset], &eigval[1], lde, &eigvec[
            eigvec_offset], &atol, &artol, &bound[3], &atemp[1], &d__[1], &
            vtemp[1]);
/*<       RETURN >*/
    return 0;
/*<       END >*/
} /* dlaeig_ */

#ifdef __cplusplus
        }
#endif