3 /* Subroutine */ int slarra_(integer *n, real *d__, real *e, real *e2, real *
4 spltol, real *tnrm, integer *nsplit, integer *isplit, integer *info)
6 /* System generated locals */
10 /* Builtin functions */
11 double sqrt(doublereal);
18 /* -- LAPACK auxiliary routine (version 3.1) -- */
19 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
22 /* .. Scalar Arguments .. */
24 /* .. Array Arguments .. */
30 /* Compute the splitting points with threshold SPLTOL. */
31 /* SLARRA sets any "small" off-diagonal elements to zero. */
36 /* N (input) INTEGER */
37 /* The order of the matrix. N > 0. */
39 /* D (input) REAL array, dimension (N) */
40 /* On entry, the N diagonal elements of the tridiagonal */
43 /* E (input/output) REAL array, dimension (N) */
44 /* On entry, the first (N-1) entries contain the subdiagonal */
45 /* elements of the tridiagonal matrix T; E(N) need not be set. */
46 /* On exit, the entries E( ISPLIT( I ) ), 1 <= I <= NSPLIT, */
47 /* are set to zero, the other entries of E are untouched. */
49 /* E2 (input/output) REAL array, dimension (N) */
50 /* On entry, the first (N-1) entries contain the SQUARES of the */
51 /* subdiagonal elements of the tridiagonal matrix T; */
52 /* E2(N) need not be set. */
53 /* On exit, the entries E2( ISPLIT( I ) ), */
54 /* 1 <= I <= NSPLIT, have been set to zero */
56 /* SPLTOL (input) REAL */
57 /* The threshold for splitting. Two criteria can be used: */
58 /* SPLTOL<0 : criterion based on absolute off-diagonal value */
59 /* SPLTOL>0 : criterion that preserves relative accuracy */
61 /* TNRM (input) REAL */
62 /* The norm of the matrix. */
64 /* NSPLIT (output) INTEGER */
65 /* The number of blocks T splits into. 1 <= NSPLIT <= N. */
67 /* ISPLIT (output) INTEGER array, dimension (N) */
68 /* The splitting points, at which T breaks up into blocks. */
69 /* The first block consists of rows/columns 1 to ISPLIT(1), */
70 /* the second of rows/columns ISPLIT(1)+1 through ISPLIT(2), */
71 /* etc., and the NSPLIT-th consists of rows/columns */
72 /* ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N. */
75 /* INFO (output) INTEGER */
76 /* = 0: successful exit */
81 /* Based on contributions by */
82 /* Beresford Parlett, University of California, Berkeley, USA */
83 /* Jim Demmel, University of California, Berkeley, USA */
84 /* Inderjit Dhillon, University of Texas, Austin, USA */
85 /* Osni Marques, LBNL/NERSC, USA */
86 /* Christof Voemel, University of California, Berkeley, USA */
88 /* ===================================================================== */
90 /* .. Parameters .. */
92 /* .. Local Scalars .. */
94 /* .. Intrinsic Functions .. */
96 /* .. Executable Statements .. */
98 /* Parameter adjustments */
106 /* Compute splitting points */
109 /* Criterion based on absolute off-diagonal value */
110 tmp1 = dabs(*spltol) * *tnrm;
112 for (i__ = 1; i__ <= i__1; ++i__) {
113 eabs = (r__1 = e[i__], dabs(r__1));
117 isplit[*nsplit] = i__;
123 /* Criterion that guarantees relative accuracy */
125 for (i__ = 1; i__ <= i__1; ++i__) {
126 eabs = (r__1 = e[i__], dabs(r__1));
127 if (eabs <= *spltol * sqrt((r__1 = d__[i__], dabs(r__1))) * sqrt((
128 r__2 = d__[i__ + 1], dabs(r__2)))) {
131 isplit[*nsplit] = i__;
137 isplit[*nsplit] = *n;