```001:       DOUBLE PRECISION FUNCTION ZLANHT( NORM, N, D, E )
002: *
003: *  -- LAPACK auxiliary routine (version 3.2) --
004: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
005: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
006: *     November 2006
007: *
008: *     .. Scalar Arguments ..
009:       CHARACTER          NORM
010:       INTEGER            N
011: *     ..
012: *     .. Array Arguments ..
013:       DOUBLE PRECISION   D( * )
014:       COMPLEX*16         E( * )
015: *     ..
016: *
017: *  Purpose
018: *  =======
019: *
020: *  ZLANHT  returns the value of the one norm,  or the Frobenius norm, or
021: *  the  infinity norm,  or the  element of  largest absolute value  of a
022: *  complex Hermitian tridiagonal matrix A.
023: *
024: *  Description
025: *  ===========
026: *
027: *  ZLANHT returns the value
028: *
029: *     ZLANHT = ( max(abs(A(i,j))), NORM = 'M' or 'm'
030: *              (
031: *              ( norm1(A),         NORM = '1', 'O' or 'o'
032: *              (
033: *              ( normI(A),         NORM = 'I' or 'i'
034: *              (
035: *              ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
036: *
037: *  where  norm1  denotes the  one norm of a matrix (maximum column sum),
038: *  normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
039: *  normF  denotes the  Frobenius norm of a matrix (square root of sum of
040: *  squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
041: *
042: *  Arguments
043: *  =========
044: *
045: *  NORM    (input) CHARACTER*1
046: *          Specifies the value to be returned in ZLANHT as described
047: *          above.
048: *
049: *  N       (input) INTEGER
050: *          The order of the matrix A.  N >= 0.  When N = 0, ZLANHT is
051: *          set to zero.
052: *
053: *  D       (input) DOUBLE PRECISION array, dimension (N)
054: *          The diagonal elements of A.
055: *
056: *  E       (input) COMPLEX*16 array, dimension (N-1)
057: *          The (n-1) sub-diagonal or super-diagonal elements of A.
058: *
059: *  =====================================================================
060: *
061: *     .. Parameters ..
062:       DOUBLE PRECISION   ONE, ZERO
063:       PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
064: *     ..
065: *     .. Local Scalars ..
066:       INTEGER            I
067:       DOUBLE PRECISION   ANORM, SCALE, SUM
068: *     ..
069: *     .. External Functions ..
070:       LOGICAL            LSAME
071:       EXTERNAL           LSAME
072: *     ..
073: *     .. External Subroutines ..
074:       EXTERNAL           DLASSQ, ZLASSQ
075: *     ..
076: *     .. Intrinsic Functions ..
077:       INTRINSIC          ABS, MAX, SQRT
078: *     ..
079: *     .. Executable Statements ..
080: *
081:       IF( N.LE.0 ) THEN
082:          ANORM = ZERO
083:       ELSE IF( LSAME( NORM, 'M' ) ) THEN
084: *
085: *        Find max(abs(A(i,j))).
086: *
087:          ANORM = ABS( D( N ) )
088:          DO 10 I = 1, N - 1
089:             ANORM = MAX( ANORM, ABS( D( I ) ) )
090:             ANORM = MAX( ANORM, ABS( E( I ) ) )
091:    10    CONTINUE
092:       ELSE IF( LSAME( NORM, 'O' ) .OR. NORM.EQ.'1' .OR.
093:      \$         LSAME( NORM, 'I' ) ) THEN
094: *
095: *        Find norm1(A).
096: *
097:          IF( N.EQ.1 ) THEN
098:             ANORM = ABS( D( 1 ) )
099:          ELSE
100:             ANORM = MAX( ABS( D( 1 ) )+ABS( E( 1 ) ),
101:      \$              ABS( E( N-1 ) )+ABS( D( N ) ) )
102:             DO 20 I = 2, N - 1
103:                ANORM = MAX( ANORM, ABS( D( I ) )+ABS( E( I ) )+
104:      \$                 ABS( E( I-1 ) ) )
105:    20       CONTINUE
106:          END IF
107:       ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
108: *
109: *        Find normF(A).
110: *
111:          SCALE = ZERO
112:          SUM = ONE
113:          IF( N.GT.1 ) THEN
114:             CALL ZLASSQ( N-1, E, 1, SCALE, SUM )
115:             SUM = 2*SUM
116:          END IF
117:          CALL DLASSQ( N, D, 1, SCALE, SUM )
118:          ANORM = SCALE*SQRT( SUM )
119:       END IF
120: *
121:       ZLANHT = ANORM
122:       RETURN
123: *
124: *     End of ZLANHT
125: *
126:       END
127: ```