LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
clanht.f
Go to the documentation of this file.
00001 *> \brief \b CLANHT
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download CLANHT + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clanht.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clanht.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clanht.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       REAL             FUNCTION CLANHT( NORM, N, D, E )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       CHARACTER          NORM
00025 *       INTEGER            N
00026 *       ..
00027 *       .. Array Arguments ..
00028 *       REAL               D( * )
00029 *       COMPLEX            E( * )
00030 *       ..
00031 *  
00032 *
00033 *> \par Purpose:
00034 *  =============
00035 *>
00036 *> \verbatim
00037 *>
00038 *> CLANHT  returns the value of the one norm,  or the Frobenius norm, or
00039 *> the  infinity norm,  or the  element of  largest absolute value  of a
00040 *> complex Hermitian tridiagonal matrix A.
00041 *> \endverbatim
00042 *>
00043 *> \return CLANHT
00044 *> \verbatim
00045 *>
00046 *>    CLANHT = ( max(abs(A(i,j))), NORM = 'M' or 'm'
00047 *>             (
00048 *>             ( norm1(A),         NORM = '1', 'O' or 'o'
00049 *>             (
00050 *>             ( normI(A),         NORM = 'I' or 'i'
00051 *>             (
00052 *>             ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
00053 *>
00054 *> where  norm1  denotes the  one norm of a matrix (maximum column sum),
00055 *> normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
00056 *> normF  denotes the  Frobenius norm of a matrix (square root of sum of
00057 *> squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
00058 *> \endverbatim
00059 *
00060 *  Arguments:
00061 *  ==========
00062 *
00063 *> \param[in] NORM
00064 *> \verbatim
00065 *>          NORM is CHARACTER*1
00066 *>          Specifies the value to be returned in CLANHT as described
00067 *>          above.
00068 *> \endverbatim
00069 *>
00070 *> \param[in] N
00071 *> \verbatim
00072 *>          N is INTEGER
00073 *>          The order of the matrix A.  N >= 0.  When N = 0, CLANHT is
00074 *>          set to zero.
00075 *> \endverbatim
00076 *>
00077 *> \param[in] D
00078 *> \verbatim
00079 *>          D is REAL array, dimension (N)
00080 *>          The diagonal elements of A.
00081 *> \endverbatim
00082 *>
00083 *> \param[in] E
00084 *> \verbatim
00085 *>          E is COMPLEX array, dimension (N-1)
00086 *>          The (n-1) sub-diagonal or super-diagonal elements of A.
00087 *> \endverbatim
00088 *
00089 *  Authors:
00090 *  ========
00091 *
00092 *> \author Univ. of Tennessee 
00093 *> \author Univ. of California Berkeley 
00094 *> \author Univ. of Colorado Denver 
00095 *> \author NAG Ltd. 
00096 *
00097 *> \date November 2011
00098 *
00099 *> \ingroup complexOTHERauxiliary
00100 *
00101 *  =====================================================================
00102       REAL             FUNCTION CLANHT( NORM, N, D, E )
00103 *
00104 *  -- LAPACK auxiliary routine (version 3.4.0) --
00105 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00106 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00107 *     November 2011
00108 *
00109 *     .. Scalar Arguments ..
00110       CHARACTER          NORM
00111       INTEGER            N
00112 *     ..
00113 *     .. Array Arguments ..
00114       REAL               D( * )
00115       COMPLEX            E( * )
00116 *     ..
00117 *
00118 *  =====================================================================
00119 *
00120 *     .. Parameters ..
00121       REAL               ONE, ZERO
00122       PARAMETER          ( ONE = 1.0E+0, ZERO = 0.0E+0 )
00123 *     ..
00124 *     .. Local Scalars ..
00125       INTEGER            I
00126       REAL               ANORM, SCALE, SUM
00127 *     ..
00128 *     .. External Functions ..
00129       LOGICAL            LSAME
00130       EXTERNAL           LSAME
00131 *     ..
00132 *     .. External Subroutines ..
00133       EXTERNAL           CLASSQ, SLASSQ
00134 *     ..
00135 *     .. Intrinsic Functions ..
00136       INTRINSIC          ABS, MAX, SQRT
00137 *     ..
00138 *     .. Executable Statements ..
00139 *
00140       IF( N.LE.0 ) THEN
00141          ANORM = ZERO
00142       ELSE IF( LSAME( NORM, 'M' ) ) THEN
00143 *
00144 *        Find max(abs(A(i,j))).
00145 *
00146          ANORM = ABS( D( N ) )
00147          DO 10 I = 1, N - 1
00148             ANORM = MAX( ANORM, ABS( D( I ) ) )
00149             ANORM = MAX( ANORM, ABS( E( I ) ) )
00150    10    CONTINUE
00151       ELSE IF( LSAME( NORM, 'O' ) .OR. NORM.EQ.'1' .OR.
00152      $         LSAME( NORM, 'I' ) ) THEN
00153 *
00154 *        Find norm1(A).
00155 *
00156          IF( N.EQ.1 ) THEN
00157             ANORM = ABS( D( 1 ) )
00158          ELSE
00159             ANORM = MAX( ABS( D( 1 ) )+ABS( E( 1 ) ),
00160      $              ABS( E( N-1 ) )+ABS( D( N ) ) )
00161             DO 20 I = 2, N - 1
00162                ANORM = MAX( ANORM, ABS( D( I ) )+ABS( E( I ) )+
00163      $                 ABS( E( I-1 ) ) )
00164    20       CONTINUE
00165          END IF
00166       ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
00167 *
00168 *        Find normF(A).
00169 *
00170          SCALE = ZERO
00171          SUM = ONE
00172          IF( N.GT.1 ) THEN
00173             CALL CLASSQ( N-1, E, 1, SCALE, SUM )
00174             SUM = 2*SUM
00175          END IF
00176          CALL SLASSQ( N, D, 1, SCALE, SUM )
00177          ANORM = SCALE*SQRT( SUM )
00178       END IF
00179 *
00180       CLANHT = ANORM
00181       RETURN
00182 *
00183 *     End of CLANHT
00184 *
00185       END
 All Files Functions