zlangt.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 166 行
HTML
166 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>zlangt.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="ZLANGT.1"></a><a href="zlangt.f.html#ZLANGT.1">ZLANGT</a>( NORM, N, DL, D, DU )
<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> COMPLEX*16 D( * ), DL( * ), DU( * )
<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="ZLANGT.18"></a><a href="zlangt.f.html#ZLANGT.1">ZLANGT</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 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="ZLANGT.25"></a><a href="zlangt.f.html#ZLANGT.1">ZLANGT</a> returns the value
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="ZLANGT.27"></a><a href="zlangt.f.html#ZLANGT.1">ZLANGT</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="ZLANGT.44"></a><a href="zlangt.f.html#ZLANGT.1">ZLANGT</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="ZLANGT.48"></a><a href="zlangt.f.html#ZLANGT.1">ZLANGT</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"> DL (input) COMPLEX*16 array, dimension (N-1)
</span><span class="comment">*</span><span class="comment"> The (n-1) sub-diagonal elements of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> D (input) COMPLEX*16 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"> DU (input) COMPLEX*16 array, dimension (N-1)
</span><span class="comment">*</span><span class="comment"> The (n-1) 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.71"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
EXTERNAL <a name="LSAME.72"></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="ZLASSQ.75"></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.84"></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( DL( I ) ) )
ANORM = MAX( ANORM, ABS( D( I ) ) )
ANORM = MAX( ANORM, ABS( DU( I ) ) )
10 CONTINUE
ELSE IF( <a name="LSAME.94"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( NORM, <span class="string">'O'</span> ) .OR. NORM.EQ.<span class="string">'1'</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( DL( 1 ) ),
$ ABS( D( N ) )+ABS( DU( N-1 ) ) )
DO 20 I = 2, N - 1
ANORM = MAX( ANORM, ABS( D( I ) )+ABS( DL( I ) )+
$ ABS( DU( I-1 ) ) )
20 CONTINUE
END IF
ELSE IF( <a name="LSAME.108"></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 normI(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( DU( 1 ) ),
$ ABS( D( N ) )+ABS( DL( N-1 ) ) )
DO 30 I = 2, N - 1
ANORM = MAX( ANORM, ABS( D( I ) )+ABS( DU( I ) )+
$ ABS( DL( I-1 ) ) )
30 CONTINUE
END IF
ELSE IF( ( <a name="LSAME.122"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( NORM, <span class="string">'F'</span> ) ) .OR. ( <a name="LSAME.122"></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
CALL <a name="ZLASSQ.128"></a><a href="zlassq.f.html#ZLASSQ.1">ZLASSQ</a>( N, D, 1, SCALE, SUM )
IF( N.GT.1 ) THEN
CALL <a name="ZLASSQ.130"></a><a href="zlassq.f.html#ZLASSQ.1">ZLASSQ</a>( N-1, DL, 1, SCALE, SUM )
CALL <a name="ZLASSQ.131"></a><a href="zlassq.f.html#ZLASSQ.1">ZLASSQ</a>( N-1, DU, 1, SCALE, SUM )
END IF
ANORM = SCALE*SQRT( SUM )
END IF
<span class="comment">*</span><span class="comment">
</span> <a name="ZLANGT.136"></a><a href="zlangt.f.html#ZLANGT.1">ZLANGT</a> = ANORM
RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> End of <a name="ZLANGT.139"></a><a href="zlangt.f.html#ZLANGT.1">ZLANGT</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?