Annotation of rpl/lapack/lapack/zlangb.f, revision 1.1

1.1     ! bertrand    1:       DOUBLE PRECISION FUNCTION ZLANGB( NORM, N, KL, KU, AB, LDAB,
        !             2:      $                 WORK )
        !             3: *
        !             4: *  -- LAPACK auxiliary routine (version 3.2) --
        !             5: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
        !             6: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
        !             7: *     November 2006
        !             8: *
        !             9: *     .. Scalar Arguments ..
        !            10:       CHARACTER          NORM
        !            11:       INTEGER            KL, KU, LDAB, N
        !            12: *     ..
        !            13: *     .. Array Arguments ..
        !            14:       DOUBLE PRECISION   WORK( * )
        !            15:       COMPLEX*16         AB( LDAB, * )
        !            16: *     ..
        !            17: *
        !            18: *  Purpose
        !            19: *  =======
        !            20: *
        !            21: *  ZLANGB  returns the value of the one norm,  or the Frobenius norm, or
        !            22: *  the  infinity norm,  or the element of  largest absolute value  of an
        !            23: *  n by n band matrix  A,  with kl sub-diagonals and ku super-diagonals.
        !            24: *
        !            25: *  Description
        !            26: *  ===========
        !            27: *
        !            28: *  ZLANGB returns the value
        !            29: *
        !            30: *     ZLANGB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
        !            31: *              (
        !            32: *              ( norm1(A),         NORM = '1', 'O' or 'o'
        !            33: *              (
        !            34: *              ( normI(A),         NORM = 'I' or 'i'
        !            35: *              (
        !            36: *              ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
        !            37: *
        !            38: *  where  norm1  denotes the  one norm of a matrix (maximum column sum),
        !            39: *  normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
        !            40: *  normF  denotes the  Frobenius norm of a matrix (square root of sum of
        !            41: *  squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
        !            42: *
        !            43: *  Arguments
        !            44: *  =========
        !            45: *
        !            46: *  NORM    (input) CHARACTER*1
        !            47: *          Specifies the value to be returned in ZLANGB as described
        !            48: *          above.
        !            49: *
        !            50: *  N       (input) INTEGER
        !            51: *          The order of the matrix A.  N >= 0.  When N = 0, ZLANGB is
        !            52: *          set to zero.
        !            53: *
        !            54: *  KL      (input) INTEGER
        !            55: *          The number of sub-diagonals of the matrix A.  KL >= 0.
        !            56: *
        !            57: *  KU      (input) INTEGER
        !            58: *          The number of super-diagonals of the matrix A.  KU >= 0.
        !            59: *
        !            60: *  AB      (input) COMPLEX*16 array, dimension (LDAB,N)
        !            61: *          The band matrix A, stored in rows 1 to KL+KU+1.  The j-th
        !            62: *          column of A is stored in the j-th column of the array AB as
        !            63: *          follows:
        !            64: *          AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).
        !            65: *
        !            66: *  LDAB    (input) INTEGER
        !            67: *          The leading dimension of the array AB.  LDAB >= KL+KU+1.
        !            68: *
        !            69: *  WORK    (workspace) DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
        !            70: *          where LWORK >= N when NORM = 'I'; otherwise, WORK is not
        !            71: *          referenced.
        !            72: *
        !            73: * =====================================================================
        !            74: *
        !            75: *     .. Parameters ..
        !            76:       DOUBLE PRECISION   ONE, ZERO
        !            77:       PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
        !            78: *     ..
        !            79: *     .. Local Scalars ..
        !            80:       INTEGER            I, J, K, L
        !            81:       DOUBLE PRECISION   SCALE, SUM, VALUE
        !            82: *     ..
        !            83: *     .. External Functions ..
        !            84:       LOGICAL            LSAME
        !            85:       EXTERNAL           LSAME
        !            86: *     ..
        !            87: *     .. External Subroutines ..
        !            88:       EXTERNAL           ZLASSQ
        !            89: *     ..
        !            90: *     .. Intrinsic Functions ..
        !            91:       INTRINSIC          ABS, MAX, MIN, SQRT
        !            92: *     ..
        !            93: *     .. Executable Statements ..
        !            94: *
        !            95:       IF( N.EQ.0 ) THEN
        !            96:          VALUE = ZERO
        !            97:       ELSE IF( LSAME( NORM, 'M' ) ) THEN
        !            98: *
        !            99: *        Find max(abs(A(i,j))).
        !           100: *
        !           101:          VALUE = ZERO
        !           102:          DO 20 J = 1, N
        !           103:             DO 10 I = MAX( KU+2-J, 1 ), MIN( N+KU+1-J, KL+KU+1 )
        !           104:                VALUE = MAX( VALUE, ABS( AB( I, J ) ) )
        !           105:    10       CONTINUE
        !           106:    20    CONTINUE
        !           107:       ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN
        !           108: *
        !           109: *        Find norm1(A).
        !           110: *
        !           111:          VALUE = ZERO
        !           112:          DO 40 J = 1, N
        !           113:             SUM = ZERO
        !           114:             DO 30 I = MAX( KU+2-J, 1 ), MIN( N+KU+1-J, KL+KU+1 )
        !           115:                SUM = SUM + ABS( AB( I, J ) )
        !           116:    30       CONTINUE
        !           117:             VALUE = MAX( VALUE, SUM )
        !           118:    40    CONTINUE
        !           119:       ELSE IF( LSAME( NORM, 'I' ) ) THEN
        !           120: *
        !           121: *        Find normI(A).
        !           122: *
        !           123:          DO 50 I = 1, N
        !           124:             WORK( I ) = ZERO
        !           125:    50    CONTINUE
        !           126:          DO 70 J = 1, N
        !           127:             K = KU + 1 - J
        !           128:             DO 60 I = MAX( 1, J-KU ), MIN( N, J+KL )
        !           129:                WORK( I ) = WORK( I ) + ABS( AB( K+I, J ) )
        !           130:    60       CONTINUE
        !           131:    70    CONTINUE
        !           132:          VALUE = ZERO
        !           133:          DO 80 I = 1, N
        !           134:             VALUE = MAX( VALUE, WORK( I ) )
        !           135:    80    CONTINUE
        !           136:       ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
        !           137: *
        !           138: *        Find normF(A).
        !           139: *
        !           140:          SCALE = ZERO
        !           141:          SUM = ONE
        !           142:          DO 90 J = 1, N
        !           143:             L = MAX( 1, J-KU )
        !           144:             K = KU + 1 - J + L
        !           145:             CALL ZLASSQ( MIN( N, J+KL )-L+1, AB( K, J ), 1, SCALE, SUM )
        !           146:    90    CONTINUE
        !           147:          VALUE = SCALE*SQRT( SUM )
        !           148:       END IF
        !           149: *
        !           150:       ZLANGB = VALUE
        !           151:       RETURN
        !           152: *
        !           153: *     End of ZLANGB
        !           154: *
        !           155:       END

CVSweb interface <joel.bertrand@systella.fr>