3 /* Subroutine */ int dlarra_(integer *n, doublereal *d__, doublereal *e,
4 doublereal *e2, doublereal *spltol, doublereal *tnrm, integer *nsplit,
5 integer *isplit, integer *info)
7 /* System generated locals */
11 /* Builtin functions */
12 double sqrt(doublereal);
16 doublereal tmp1, eabs;
19 /* -- LAPACK auxiliary routine (version 3.1) -- */
20 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
23 /* .. Scalar Arguments .. */
25 /* .. Array Arguments .. */
31 /* Compute the splitting points with threshold SPLTOL. */
32 /* DLARRA sets any "small" off-diagonal elements to zero. */
37 /* N (input) INTEGER */
38 /* The order of the matrix. N > 0. */
40 /* D (input) DOUBLE PRECISION array, dimension (N) */
41 /* On entry, the N diagonal elements of the tridiagonal */
44 /* E (input/output) DOUBLE PRECISION array, dimension (N) */
45 /* On entry, the first (N-1) entries contain the subdiagonal */
46 /* elements of the tridiagonal matrix T; E(N) need not be set. */
47 /* On exit, the entries E( ISPLIT( I ) ), 1 <= I <= NSPLIT, */
48 /* are set to zero, the other entries of E are untouched. */
50 /* E2 (input/output) DOUBLE PRECISION array, dimension (N) */
51 /* On entry, the first (N-1) entries contain the SQUARES of the */
52 /* subdiagonal elements of the tridiagonal matrix T; */
53 /* E2(N) need not be set. */
54 /* On exit, the entries E2( ISPLIT( I ) ), */
55 /* 1 <= I <= NSPLIT, have been set to zero */
57 /* SPLTOL (input) DOUBLE PRECISION */
58 /* The threshold for splitting. Two criteria can be used: */
59 /* SPLTOL<0 : criterion based on absolute off-diagonal value */
60 /* SPLTOL>0 : criterion that preserves relative accuracy */
62 /* TNRM (input) DOUBLE PRECISION */
63 /* The norm of the matrix. */
65 /* NSPLIT (output) INTEGER */
66 /* The number of blocks T splits into. 1 <= NSPLIT <= N. */
68 /* ISPLIT (output) INTEGER array, dimension (N) */
69 /* The splitting points, at which T breaks up into blocks. */
70 /* The first block consists of rows/columns 1 to ISPLIT(1), */
71 /* the second of rows/columns ISPLIT(1)+1 through ISPLIT(2), */
72 /* etc., and the NSPLIT-th consists of rows/columns */
73 /* ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N. */
76 /* INFO (output) INTEGER */
77 /* = 0: successful exit */
82 /* Based on contributions by */
83 /* Beresford Parlett, University of California, Berkeley, USA */
84 /* Jim Demmel, University of California, Berkeley, USA */
85 /* Inderjit Dhillon, University of Texas, Austin, USA */
86 /* Osni Marques, LBNL/NERSC, USA */
87 /* Christof Voemel, University of California, Berkeley, USA */
89 /* ===================================================================== */
91 /* .. Parameters .. */
93 /* .. Local Scalars .. */
95 /* .. Intrinsic Functions .. */
97 /* .. Executable Statements .. */
99 /* Parameter adjustments */
107 /* Compute splitting points */
110 /* Criterion based on absolute off-diagonal value */
111 tmp1 = abs(*spltol) * *tnrm;
113 for (i__ = 1; i__ <= i__1; ++i__) {
114 eabs = (d__1 = e[i__], abs(d__1));
118 isplit[*nsplit] = i__;
124 /* Criterion that guarantees relative accuracy */
126 for (i__ = 1; i__ <= i__1; ++i__) {
127 eabs = (d__1 = e[i__], abs(d__1));
128 if (eabs <= *spltol * sqrt((d__1 = d__[i__], abs(d__1))) * sqrt((
129 d__2 = d__[i__ + 1], abs(d__2)))) {
132 isplit[*nsplit] = i__;
138 isplit[*nsplit] = *n;