1 DOUBLE PRECISION FUNCTION DLANST( NORM, N, D, E )
3 ! -- LAPACK auxiliary routine (version 3.1) --
4 ! Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
7 ! .. Scalar Arguments ..
11 ! .. Array Arguments ..
12 DOUBLE PRECISION D( * ), E( * )
18 ! DLANST returns the value of the one norm, or the Frobenius norm, or
19 ! the infinity norm, or the element of largest absolute value of a
20 ! real symmetric tridiagonal matrix A.
25 ! DLANST returns the value
27 ! DLANST = ( max(abs(A(i,j))), NORM = 'M' or 'm'
29 ! ( norm1(A), NORM = '1', 'O' or 'o'
31 ! ( normI(A), NORM = 'I' or 'i'
33 ! ( normF(A), NORM = 'F', 'f', 'E' or 'e'
35 ! where norm1 denotes the one norm of a matrix (maximum column sum),
36 ! normI denotes the infinity norm of a matrix (maximum row sum) and
37 ! normF denotes the Frobenius norm of a matrix (square root of sum of
38 ! squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
43 ! NORM (input) CHARACTER*1
44 ! Specifies the value to be returned in DLANST as described
48 ! The order of the matrix A. N >= 0. When N = 0, DLANST is
51 ! D (input) DOUBLE PRECISION array, dimension (N)
52 ! The diagonal elements of A.
54 ! E (input) DOUBLE PRECISION array, dimension (N-1)
55 ! The (n-1) sub-diagonal or super-diagonal elements of A.
57 ! =====================================================================
60 DOUBLE PRECISION ONE, ZERO
61 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
65 DOUBLE PRECISION ANORM, SCALE, SUM
67 ! .. External Functions ..
71 ! .. External Subroutines ..
74 ! .. Intrinsic Functions ..
75 INTRINSIC ABS, MAX, SQRT
77 ! .. Executable Statements ..
81 ELSE IF( LSAME( NORM, 'M' ) ) THEN
83 ! Find max(abs(A(i,j))).
87 ANORM = MAX( ANORM, ABS( D( I ) ) )
88 ANORM = MAX( ANORM, ABS( E( I ) ) )
90 ELSE IF( LSAME( NORM, 'O' ) .OR. NORM.EQ.'1' .OR. &
91 LSAME( NORM, 'I' ) ) THEN
98 ANORM = MAX( ABS( D( 1 ) )+ABS( E( 1 ) ), &
99 ABS( E( N-1 ) )+ABS( D( N ) ) )
101 ANORM = MAX( ANORM, ABS( D( I ) )+ABS( E( I ) )+ &
105 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
112 CALL DLASSQ( N-1, E, 1, SCALE, SUM )
115 CALL DLASSQ( N, D, 1, SCALE, SUM )
116 ANORM = SCALE*SQRT( SUM )