Annotation of rpl/lapack/lapack/zlangt.f, revision 1.9

1.8       bertrand    1: *> \brief \b ZLANGT
                      2: *
                      3: *  =========== DOCUMENTATION ===========
                      4: *
                      5: * Online html documentation available at 
                      6: *            http://www.netlib.org/lapack/explore-html/ 
                      7: *
                      8: *> \htmlonly
                      9: *> Download ZLANGT + dependencies 
                     10: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlangt.f"> 
                     11: *> [TGZ]</a> 
                     12: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlangt.f"> 
                     13: *> [ZIP]</a> 
                     14: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlangt.f"> 
                     15: *> [TXT]</a>
                     16: *> \endhtmlonly 
                     17: *
                     18: *  Definition:
                     19: *  ===========
                     20: *
                     21: *       DOUBLE PRECISION FUNCTION ZLANGT( NORM, N, DL, D, DU )
                     22: * 
                     23: *       .. Scalar Arguments ..
                     24: *       CHARACTER          NORM
                     25: *       INTEGER            N
                     26: *       ..
                     27: *       .. Array Arguments ..
                     28: *       COMPLEX*16         D( * ), DL( * ), DU( * )
                     29: *       ..
                     30: *  
                     31: *
                     32: *> \par Purpose:
                     33: *  =============
                     34: *>
                     35: *> \verbatim
                     36: *>
                     37: *> ZLANGT  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: *> complex tridiagonal matrix A.
                     40: *> \endverbatim
                     41: *>
                     42: *> \return ZLANGT
                     43: *> \verbatim
                     44: *>
                     45: *>    ZLANGT = ( max(abs(A(i,j))), NORM = 'M' or 'm'
                     46: *>             (
                     47: *>             ( norm1(A),         NORM = '1', 'O' or 'o'
                     48: *>             (
                     49: *>             ( normI(A),         NORM = 'I' or 'i'
                     50: *>             (
                     51: *>             ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
                     52: *>
                     53: *> where  norm1  denotes the  one norm of a matrix (maximum column sum),
                     54: *> normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
                     55: *> normF  denotes the  Frobenius norm of a matrix (square root of sum of
                     56: *> squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
                     57: *> \endverbatim
                     58: *
                     59: *  Arguments:
                     60: *  ==========
                     61: *
                     62: *> \param[in] NORM
                     63: *> \verbatim
                     64: *>          NORM is CHARACTER*1
                     65: *>          Specifies the value to be returned in ZLANGT as described
                     66: *>          above.
                     67: *> \endverbatim
                     68: *>
                     69: *> \param[in] N
                     70: *> \verbatim
                     71: *>          N is INTEGER
                     72: *>          The order of the matrix A.  N >= 0.  When N = 0, ZLANGT is
                     73: *>          set to zero.
                     74: *> \endverbatim
                     75: *>
                     76: *> \param[in] DL
                     77: *> \verbatim
                     78: *>          DL is COMPLEX*16 array, dimension (N-1)
                     79: *>          The (n-1) sub-diagonal elements of A.
                     80: *> \endverbatim
                     81: *>
                     82: *> \param[in] D
                     83: *> \verbatim
                     84: *>          D is COMPLEX*16 array, dimension (N)
                     85: *>          The diagonal elements of A.
                     86: *> \endverbatim
                     87: *>
                     88: *> \param[in] DU
                     89: *> \verbatim
                     90: *>          DU is COMPLEX*16 array, dimension (N-1)
                     91: *>          The (n-1) super-diagonal elements of A.
                     92: *> \endverbatim
                     93: *
                     94: *  Authors:
                     95: *  ========
                     96: *
                     97: *> \author Univ. of Tennessee 
                     98: *> \author Univ. of California Berkeley 
                     99: *> \author Univ. of Colorado Denver 
                    100: *> \author NAG Ltd. 
                    101: *
                    102: *> \date November 2011
                    103: *
                    104: *> \ingroup complex16OTHERauxiliary
                    105: *
                    106: *  =====================================================================
1.1       bertrand  107:       DOUBLE PRECISION FUNCTION ZLANGT( NORM, N, DL, D, DU )
                    108: *
1.8       bertrand  109: *  -- LAPACK auxiliary routine (version 3.4.0) --
1.1       bertrand  110: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
                    111: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
1.8       bertrand  112: *     November 2011
1.1       bertrand  113: *
                    114: *     .. Scalar Arguments ..
                    115:       CHARACTER          NORM
                    116:       INTEGER            N
                    117: *     ..
                    118: *     .. Array Arguments ..
                    119:       COMPLEX*16         D( * ), DL( * ), DU( * )
                    120: *     ..
                    121: *
                    122: *  =====================================================================
                    123: *
                    124: *     .. Parameters ..
                    125:       DOUBLE PRECISION   ONE, ZERO
                    126:       PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
                    127: *     ..
                    128: *     .. Local Scalars ..
                    129:       INTEGER            I
                    130:       DOUBLE PRECISION   ANORM, SCALE, SUM
                    131: *     ..
                    132: *     .. External Functions ..
                    133:       LOGICAL            LSAME
                    134:       EXTERNAL           LSAME
                    135: *     ..
                    136: *     .. External Subroutines ..
                    137:       EXTERNAL           ZLASSQ
                    138: *     ..
                    139: *     .. Intrinsic Functions ..
                    140:       INTRINSIC          ABS, MAX, SQRT
                    141: *     ..
                    142: *     .. Executable Statements ..
                    143: *
                    144:       IF( N.LE.0 ) THEN
                    145:          ANORM = ZERO
                    146:       ELSE IF( LSAME( NORM, 'M' ) ) THEN
                    147: *
                    148: *        Find max(abs(A(i,j))).
                    149: *
                    150:          ANORM = ABS( D( N ) )
                    151:          DO 10 I = 1, N - 1
                    152:             ANORM = MAX( ANORM, ABS( DL( I ) ) )
                    153:             ANORM = MAX( ANORM, ABS( D( I ) ) )
                    154:             ANORM = MAX( ANORM, ABS( DU( I ) ) )
                    155:    10    CONTINUE
                    156:       ELSE IF( LSAME( NORM, 'O' ) .OR. NORM.EQ.'1' ) THEN
                    157: *
                    158: *        Find norm1(A).
                    159: *
                    160:          IF( N.EQ.1 ) THEN
                    161:             ANORM = ABS( D( 1 ) )
                    162:          ELSE
                    163:             ANORM = MAX( ABS( D( 1 ) )+ABS( DL( 1 ) ),
                    164:      $              ABS( D( N ) )+ABS( DU( N-1 ) ) )
                    165:             DO 20 I = 2, N - 1
                    166:                ANORM = MAX( ANORM, ABS( D( I ) )+ABS( DL( I ) )+
                    167:      $                 ABS( DU( I-1 ) ) )
                    168:    20       CONTINUE
                    169:          END IF
                    170:       ELSE IF( LSAME( NORM, 'I' ) ) THEN
                    171: *
                    172: *        Find normI(A).
                    173: *
                    174:          IF( N.EQ.1 ) THEN
                    175:             ANORM = ABS( D( 1 ) )
                    176:          ELSE
                    177:             ANORM = MAX( ABS( D( 1 ) )+ABS( DU( 1 ) ),
                    178:      $              ABS( D( N ) )+ABS( DL( N-1 ) ) )
                    179:             DO 30 I = 2, N - 1
                    180:                ANORM = MAX( ANORM, ABS( D( I ) )+ABS( DU( I ) )+
                    181:      $                 ABS( DL( I-1 ) ) )
                    182:    30       CONTINUE
                    183:          END IF
                    184:       ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
                    185: *
                    186: *        Find normF(A).
                    187: *
                    188:          SCALE = ZERO
                    189:          SUM = ONE
                    190:          CALL ZLASSQ( N, D, 1, SCALE, SUM )
                    191:          IF( N.GT.1 ) THEN
                    192:             CALL ZLASSQ( N-1, DL, 1, SCALE, SUM )
                    193:             CALL ZLASSQ( N-1, DU, 1, SCALE, SUM )
                    194:          END IF
                    195:          ANORM = SCALE*SQRT( SUM )
                    196:       END IF
                    197: *
                    198:       ZLANGT = ANORM
                    199:       RETURN
                    200: *
                    201: *     End of ZLANGT
                    202: *
                    203:       END

CVSweb interface <joel.bertrand@systella.fr>