LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
zlanhb.f
Go to the documentation of this file.
00001 *> \brief \b ZLANHB
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download ZLANHB + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlanhb.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlanhb.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlanhb.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       DOUBLE PRECISION FUNCTION ZLANHB( NORM, UPLO, N, K, AB, LDAB,
00022 *                        WORK )
00023 * 
00024 *       .. Scalar Arguments ..
00025 *       CHARACTER          NORM, UPLO
00026 *       INTEGER            K, LDAB, N
00027 *       ..
00028 *       .. Array Arguments ..
00029 *       DOUBLE PRECISION   WORK( * )
00030 *       COMPLEX*16         AB( LDAB, * )
00031 *       ..
00032 *  
00033 *
00034 *> \par Purpose:
00035 *  =============
00036 *>
00037 *> \verbatim
00038 *>
00039 *> ZLANHB  returns the value of the one norm,  or the Frobenius norm, or
00040 *> the  infinity norm,  or the element of  largest absolute value  of an
00041 *> n by n hermitian band matrix A,  with k super-diagonals.
00042 *> \endverbatim
00043 *>
00044 *> \return ZLANHB
00045 *> \verbatim
00046 *>
00047 *>    ZLANHB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
00048 *>             (
00049 *>             ( norm1(A),         NORM = '1', 'O' or 'o'
00050 *>             (
00051 *>             ( normI(A),         NORM = 'I' or 'i'
00052 *>             (
00053 *>             ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
00054 *>
00055 *> where  norm1  denotes the  one norm of a matrix (maximum column sum),
00056 *> normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
00057 *> normF  denotes the  Frobenius norm of a matrix (square root of sum of
00058 *> squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
00059 *> \endverbatim
00060 *
00061 *  Arguments:
00062 *  ==========
00063 *
00064 *> \param[in] NORM
00065 *> \verbatim
00066 *>          NORM is CHARACTER*1
00067 *>          Specifies the value to be returned in ZLANHB as described
00068 *>          above.
00069 *> \endverbatim
00070 *>
00071 *> \param[in] UPLO
00072 *> \verbatim
00073 *>          UPLO is CHARACTER*1
00074 *>          Specifies whether the upper or lower triangular part of the
00075 *>          band matrix A is supplied.
00076 *>          = 'U':  Upper triangular
00077 *>          = 'L':  Lower triangular
00078 *> \endverbatim
00079 *>
00080 *> \param[in] N
00081 *> \verbatim
00082 *>          N is INTEGER
00083 *>          The order of the matrix A.  N >= 0.  When N = 0, ZLANHB is
00084 *>          set to zero.
00085 *> \endverbatim
00086 *>
00087 *> \param[in] K
00088 *> \verbatim
00089 *>          K is INTEGER
00090 *>          The number of super-diagonals or sub-diagonals of the
00091 *>          band matrix A.  K >= 0.
00092 *> \endverbatim
00093 *>
00094 *> \param[in] AB
00095 *> \verbatim
00096 *>          AB is COMPLEX*16 array, dimension (LDAB,N)
00097 *>          The upper or lower triangle of the hermitian band matrix A,
00098 *>          stored in the first K+1 rows of AB.  The j-th column of A is
00099 *>          stored in the j-th column of the array AB as follows:
00100 *>          if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
00101 *>          if UPLO = 'L', AB(1+i-j,j)   = A(i,j) for j<=i<=min(n,j+k).
00102 *>          Note that the imaginary parts of the diagonal elements need
00103 *>          not be set and are assumed to be zero.
00104 *> \endverbatim
00105 *>
00106 *> \param[in] LDAB
00107 *> \verbatim
00108 *>          LDAB is INTEGER
00109 *>          The leading dimension of the array AB.  LDAB >= K+1.
00110 *> \endverbatim
00111 *>
00112 *> \param[out] WORK
00113 *> \verbatim
00114 *>          WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
00115 *>          where LWORK >= N when NORM = 'I' or '1' or 'O'; otherwise,
00116 *>          WORK is not referenced.
00117 *> \endverbatim
00118 *
00119 *  Authors:
00120 *  ========
00121 *
00122 *> \author Univ. of Tennessee 
00123 *> \author Univ. of California Berkeley 
00124 *> \author Univ. of Colorado Denver 
00125 *> \author NAG Ltd. 
00126 *
00127 *> \date November 2011
00128 *
00129 *> \ingroup complex16OTHERauxiliary
00130 *
00131 *  =====================================================================
00132       DOUBLE PRECISION FUNCTION ZLANHB( NORM, UPLO, N, K, AB, LDAB,
00133      $                 WORK )
00134 *
00135 *  -- LAPACK auxiliary routine (version 3.4.0) --
00136 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00137 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00138 *     November 2011
00139 *
00140 *     .. Scalar Arguments ..
00141       CHARACTER          NORM, UPLO
00142       INTEGER            K, LDAB, N
00143 *     ..
00144 *     .. Array Arguments ..
00145       DOUBLE PRECISION   WORK( * )
00146       COMPLEX*16         AB( LDAB, * )
00147 *     ..
00148 *
00149 * =====================================================================
00150 *
00151 *     .. Parameters ..
00152       DOUBLE PRECISION   ONE, ZERO
00153       PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
00154 *     ..
00155 *     .. Local Scalars ..
00156       INTEGER            I, J, L
00157       DOUBLE PRECISION   ABSA, SCALE, SUM, VALUE
00158 *     ..
00159 *     .. External Functions ..
00160       LOGICAL            LSAME
00161       EXTERNAL           LSAME
00162 *     ..
00163 *     .. External Subroutines ..
00164       EXTERNAL           ZLASSQ
00165 *     ..
00166 *     .. Intrinsic Functions ..
00167       INTRINSIC          ABS, DBLE, MAX, MIN, SQRT
00168 *     ..
00169 *     .. Executable Statements ..
00170 *
00171       IF( N.EQ.0 ) THEN
00172          VALUE = ZERO
00173       ELSE IF( LSAME( NORM, 'M' ) ) THEN
00174 *
00175 *        Find max(abs(A(i,j))).
00176 *
00177          VALUE = ZERO
00178          IF( LSAME( UPLO, 'U' ) ) THEN
00179             DO 20 J = 1, N
00180                DO 10 I = MAX( K+2-J, 1 ), K
00181                   VALUE = MAX( VALUE, ABS( AB( I, J ) ) )
00182    10          CONTINUE
00183                VALUE = MAX( VALUE, ABS( DBLE( AB( K+1, J ) ) ) )
00184    20       CONTINUE
00185          ELSE
00186             DO 40 J = 1, N
00187                VALUE = MAX( VALUE, ABS( DBLE( AB( 1, J ) ) ) )
00188                DO 30 I = 2, MIN( N+1-J, K+1 )
00189                   VALUE = MAX( VALUE, ABS( AB( I, J ) ) )
00190    30          CONTINUE
00191    40       CONTINUE
00192          END IF
00193       ELSE IF( ( LSAME( NORM, 'I' ) ) .OR. ( LSAME( NORM, 'O' ) ) .OR.
00194      $         ( NORM.EQ.'1' ) ) THEN
00195 *
00196 *        Find normI(A) ( = norm1(A), since A is hermitian).
00197 *
00198          VALUE = ZERO
00199          IF( LSAME( UPLO, 'U' ) ) THEN
00200             DO 60 J = 1, N
00201                SUM = ZERO
00202                L = K + 1 - J
00203                DO 50 I = MAX( 1, J-K ), J - 1
00204                   ABSA = ABS( AB( L+I, J ) )
00205                   SUM = SUM + ABSA
00206                   WORK( I ) = WORK( I ) + ABSA
00207    50          CONTINUE
00208                WORK( J ) = SUM + ABS( DBLE( AB( K+1, J ) ) )
00209    60       CONTINUE
00210             DO 70 I = 1, N
00211                VALUE = MAX( VALUE, WORK( I ) )
00212    70       CONTINUE
00213          ELSE
00214             DO 80 I = 1, N
00215                WORK( I ) = ZERO
00216    80       CONTINUE
00217             DO 100 J = 1, N
00218                SUM = WORK( J ) + ABS( DBLE( AB( 1, J ) ) )
00219                L = 1 - J
00220                DO 90 I = J + 1, MIN( N, J+K )
00221                   ABSA = ABS( AB( L+I, J ) )
00222                   SUM = SUM + ABSA
00223                   WORK( I ) = WORK( I ) + ABSA
00224    90          CONTINUE
00225                VALUE = MAX( VALUE, SUM )
00226   100       CONTINUE
00227          END IF
00228       ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
00229 *
00230 *        Find normF(A).
00231 *
00232          SCALE = ZERO
00233          SUM = ONE
00234          IF( K.GT.0 ) THEN
00235             IF( LSAME( UPLO, 'U' ) ) THEN
00236                DO 110 J = 2, N
00237                   CALL ZLASSQ( MIN( J-1, K ), AB( MAX( K+2-J, 1 ), J ),
00238      $                         1, SCALE, SUM )
00239   110          CONTINUE
00240                L = K + 1
00241             ELSE
00242                DO 120 J = 1, N - 1
00243                   CALL ZLASSQ( MIN( N-J, K ), AB( 2, J ), 1, SCALE,
00244      $                         SUM )
00245   120          CONTINUE
00246                L = 1
00247             END IF
00248             SUM = 2*SUM
00249          ELSE
00250             L = 1
00251          END IF
00252          DO 130 J = 1, N
00253             IF( DBLE( AB( L, J ) ).NE.ZERO ) THEN
00254                ABSA = ABS( DBLE( AB( L, J ) ) )
00255                IF( SCALE.LT.ABSA ) THEN
00256                   SUM = ONE + SUM*( SCALE / ABSA )**2
00257                   SCALE = ABSA
00258                ELSE
00259                   SUM = SUM + ( ABSA / SCALE )**2
00260                END IF
00261             END IF
00262   130    CONTINUE
00263          VALUE = SCALE*SQRT( SUM )
00264       END IF
00265 *
00266       ZLANHB = VALUE
00267       RETURN
00268 *
00269 *     End of ZLANHB
00270 *
00271       END
 All Files Functions