zlanht.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 150 行
HTML
150 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>zlanht.f</title>
<meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!--
body { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default a { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.string { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.string a { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.comment { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.comment a { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
--></style>
</head>
<body>
<pre>
DOUBLE PRECISION FUNCTION <a name="ZLANHT.1"></a><a href="zlanht.f.html#ZLANHT.1">ZLANHT</a>( NORM, N, D, E )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK auxiliary routine (version 3.1) --
</span><span class="comment">*</span><span class="comment"> Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment"> November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> CHARACTER NORM
INTEGER N
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> DOUBLE PRECISION D( * )
COMPLEX*16 E( * )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Purpose
</span><span class="comment">*</span><span class="comment"> =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="ZLANHT.19"></a><a href="zlanht.f.html#ZLANHT.1">ZLANHT</a> returns the value of the one norm, or the Frobenius norm, or
</span><span class="comment">*</span><span class="comment"> the infinity norm, or the element of largest absolute value of a
</span><span class="comment">*</span><span class="comment"> complex Hermitian tridiagonal matrix A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Description
</span><span class="comment">*</span><span class="comment"> ===========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="ZLANHT.26"></a><a href="zlanht.f.html#ZLANHT.1">ZLANHT</a> returns the value
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="ZLANHT.28"></a><a href="zlanht.f.html#ZLANHT.1">ZLANHT</a> = ( max(abs(A(i,j))), NORM = 'M' or 'm'
</span><span class="comment">*</span><span class="comment"> (
</span><span class="comment">*</span><span class="comment"> ( norm1(A), NORM = '1', 'O' or 'o'
</span><span class="comment">*</span><span class="comment"> (
</span><span class="comment">*</span><span class="comment"> ( normI(A), NORM = 'I' or 'i'
</span><span class="comment">*</span><span class="comment"> (
</span><span class="comment">*</span><span class="comment"> ( normF(A), NORM = 'F', 'f', 'E' or 'e'
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where norm1 denotes the one norm of a matrix (maximum column sum),
</span><span class="comment">*</span><span class="comment"> normI denotes the infinity norm of a matrix (maximum row sum) and
</span><span class="comment">*</span><span class="comment"> normF denotes the Frobenius norm of a matrix (square root of sum of
</span><span class="comment">*</span><span class="comment"> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Arguments
</span><span class="comment">*</span><span class="comment"> =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> NORM (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> Specifies the value to be returned in <a name="ZLANHT.45"></a><a href="zlanht.f.html#ZLANHT.1">ZLANHT</a> as described
</span><span class="comment">*</span><span class="comment"> above.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> N (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The order of the matrix A. N >= 0. When N = 0, <a name="ZLANHT.49"></a><a href="zlanht.f.html#ZLANHT.1">ZLANHT</a> is
</span><span class="comment">*</span><span class="comment"> set to zero.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> D (input) DOUBLE PRECISION array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The diagonal elements of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> E (input) COMPLEX*16 array, dimension (N-1)
</span><span class="comment">*</span><span class="comment"> The (n-1) sub-diagonal or super-diagonal elements of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> =====================================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Parameters ..
</span> DOUBLE PRECISION ONE, ZERO
PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> INTEGER I
DOUBLE PRECISION ANORM, SCALE, SUM
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.69"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
EXTERNAL <a name="LSAME.70"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="DLASSQ.73"></a><a href="dlassq.f.html#DLASSQ.1">DLASSQ</a>, <a name="ZLASSQ.73"></a><a href="zlassq.f.html#ZLASSQ.1">ZLASSQ</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC ABS, MAX, SQRT
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span> IF( N.LE.0 ) THEN
ANORM = ZERO
ELSE IF( <a name="LSAME.82"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( NORM, <span class="string">'M'</span> ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Find max(abs(A(i,j))).
</span><span class="comment">*</span><span class="comment">
</span> ANORM = ABS( D( N ) )
DO 10 I = 1, N - 1
ANORM = MAX( ANORM, ABS( D( I ) ) )
ANORM = MAX( ANORM, ABS( E( I ) ) )
10 CONTINUE
ELSE IF( <a name="LSAME.91"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( NORM, <span class="string">'O'</span> ) .OR. NORM.EQ.<span class="string">'1'</span> .OR.
$ <a name="LSAME.92"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( NORM, <span class="string">'I'</span> ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Find norm1(A).
</span><span class="comment">*</span><span class="comment">
</span> IF( N.EQ.1 ) THEN
ANORM = ABS( D( 1 ) )
ELSE
ANORM = MAX( ABS( D( 1 ) )+ABS( E( 1 ) ),
$ ABS( E( N-1 ) )+ABS( D( N ) ) )
DO 20 I = 2, N - 1
ANORM = MAX( ANORM, ABS( D( I ) )+ABS( E( I ) )+
$ ABS( E( I-1 ) ) )
20 CONTINUE
END IF
ELSE IF( ( <a name="LSAME.106"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( NORM, <span class="string">'F'</span> ) ) .OR. ( <a name="LSAME.106"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( NORM, <span class="string">'E'</span> ) ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Find normF(A).
</span><span class="comment">*</span><span class="comment">
</span> SCALE = ZERO
SUM = ONE
IF( N.GT.1 ) THEN
CALL <a name="ZLASSQ.113"></a><a href="zlassq.f.html#ZLASSQ.1">ZLASSQ</a>( N-1, E, 1, SCALE, SUM )
SUM = 2*SUM
END IF
CALL <a name="DLASSQ.116"></a><a href="dlassq.f.html#DLASSQ.1">DLASSQ</a>( N, D, 1, SCALE, SUM )
ANORM = SCALE*SQRT( SUM )
END IF
<span class="comment">*</span><span class="comment">
</span> <a name="ZLANHT.120"></a><a href="zlanht.f.html#ZLANHT.1">ZLANHT</a> = ANORM
RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> End of <a name="ZLANHT.123"></a><a href="zlanht.f.html#ZLANHT.1">ZLANHT</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?