3 /* Table of constant values */
5 static integer c__1 = 1;
7 doublereal dlanst_(char *norm, integer *n, doublereal *d__, doublereal *e)
9 /* System generated locals */
11 doublereal ret_val, d__1, d__2, d__3, d__4, d__5;
13 /* Builtin functions */
14 double sqrt(doublereal);
18 doublereal sum, scale;
19 extern logical lsame_(char *, char *);
21 extern /* Subroutine */ int dlassq_(integer *, doublereal *, integer *,
22 doublereal *, doublereal *);
25 /* -- LAPACK auxiliary routine (version 3.1) -- */
26 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
29 /* .. Scalar Arguments .. */
31 /* .. Array Arguments .. */
37 /* DLANST returns the value of the one norm, or the Frobenius norm, or */
38 /* the infinity norm, or the element of largest absolute value of a */
39 /* real symmetric tridiagonal matrix A. */
44 /* DLANST returns the value */
46 /* DLANST = ( max(abs(A(i,j))), NORM = 'M' or 'm' */
48 /* ( norm1(A), NORM = '1', 'O' or 'o' */
50 /* ( normI(A), NORM = 'I' or 'i' */
52 /* ( normF(A), NORM = 'F', 'f', 'E' or 'e' */
54 /* where norm1 denotes the one norm of a matrix (maximum column sum), */
55 /* normI denotes the infinity norm of a matrix (maximum row sum) and */
56 /* normF denotes the Frobenius norm of a matrix (square root of sum of */
57 /* squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. */
62 /* NORM (input) CHARACTER*1 */
63 /* Specifies the value to be returned in DLANST as described */
66 /* N (input) INTEGER */
67 /* The order of the matrix A. N >= 0. When N = 0, DLANST is */
70 /* D (input) DOUBLE PRECISION array, dimension (N) */
71 /* The diagonal elements of A. */
73 /* E (input) DOUBLE PRECISION array, dimension (N-1) */
74 /* The (n-1) sub-diagonal or super-diagonal elements of A. */
76 /* ===================================================================== */
78 /* .. Parameters .. */
80 /* .. Local Scalars .. */
82 /* .. External Functions .. */
84 /* .. External Subroutines .. */
86 /* .. Intrinsic Functions .. */
88 /* .. Executable Statements .. */
90 /* Parameter adjustments */
97 } else if (lsame_(norm, "M")) {
99 /* Find max(abs(A(i,j))). */
101 anorm = (d__1 = d__[*n], abs(d__1));
103 for (i__ = 1; i__ <= i__1; ++i__) {
105 d__2 = anorm, d__3 = (d__1 = d__[i__], abs(d__1));
106 anorm = max(d__2,d__3);
108 d__2 = anorm, d__3 = (d__1 = e[i__], abs(d__1));
109 anorm = max(d__2,d__3);
112 } else if (lsame_(norm, "O") || *(unsigned char *)
113 norm == '1' || lsame_(norm, "I")) {
121 d__3 = abs(d__[1]) + abs(e[1]), d__4 = (d__1 = e[*n - 1], abs(
122 d__1)) + (d__2 = d__[*n], abs(d__2));
123 anorm = max(d__3,d__4);
125 for (i__ = 2; i__ <= i__1; ++i__) {
127 d__4 = anorm, d__5 = (d__1 = d__[i__], abs(d__1)) + (d__2 = e[
128 i__], abs(d__2)) + (d__3 = e[i__ - 1], abs(d__3));
129 anorm = max(d__4,d__5);
133 } else if (lsame_(norm, "F") || lsame_(norm, "E")) {
141 dlassq_(&i__1, &e[1], &c__1, &scale, &sum);
144 dlassq_(n, &d__[1], &c__1, &scale, &sum);
145 anorm = scale * sqrt(sum);