ztbmv.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 388 行 · 第 1/2 页
HTML
388 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ztbmv.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>
SUBROUTINE <a name="ZTBMV.1"></a><a href="ztbmv.f.html#ZTBMV.1">ZTBMV</a>(UPLO,TRANS,DIAG,N,K,A,LDA,X,INCX)
<span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> INTEGER INCX,K,LDA,N
CHARACTER DIAG,TRANS,UPLO
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> DOUBLE COMPLEX A(LDA,*),X(*)
<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="ZTBMV.13"></a><a href="ztbmv.f.html#ZTBMV.1">ZTBMV</a> performs one of the matrix-vector operations
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> x := A*x, or x := A'*x, or x := conjg( A' )*x,
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where x is an n element vector and A is an n by n unit, or non-unit,
</span><span class="comment">*</span><span class="comment"> upper or lower triangular band matrix, with ( k + 1 ) diagonals.
</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"> UPLO - CHARACTER*1.
</span><span class="comment">*</span><span class="comment"> On entry, UPLO specifies whether the matrix is an upper or
</span><span class="comment">*</span><span class="comment"> lower triangular matrix as follows:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> UPLO = 'U' or 'u' A is an upper triangular matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> UPLO = 'L' or 'l' A is a lower triangular matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Unchanged on exit.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> TRANS - CHARACTER*1.
</span><span class="comment">*</span><span class="comment"> On entry, TRANS specifies the operation to be performed as
</span><span class="comment">*</span><span class="comment"> follows:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> TRANS = 'N' or 'n' x := A*x.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> TRANS = 'T' or 't' x := A'*x.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> TRANS = 'C' or 'c' x := conjg( A' )*x.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Unchanged on exit.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DIAG - CHARACTER*1.
</span><span class="comment">*</span><span class="comment"> On entry, DIAG specifies whether or not A is unit
</span><span class="comment">*</span><span class="comment"> triangular as follows:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DIAG = 'U' or 'u' A is assumed to be unit triangular.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DIAG = 'N' or 'n' A is not assumed to be unit
</span><span class="comment">*</span><span class="comment"> triangular.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Unchanged on exit.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> N - INTEGER.
</span><span class="comment">*</span><span class="comment"> On entry, N specifies the order of the matrix A.
</span><span class="comment">*</span><span class="comment"> N must be at least zero.
</span><span class="comment">*</span><span class="comment"> Unchanged on exit.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> K - INTEGER.
</span><span class="comment">*</span><span class="comment"> On entry with UPLO = 'U' or 'u', K specifies the number of
</span><span class="comment">*</span><span class="comment"> super-diagonals of the matrix A.
</span><span class="comment">*</span><span class="comment"> On entry with UPLO = 'L' or 'l', K specifies the number of
</span><span class="comment">*</span><span class="comment"> sub-diagonals of the matrix A.
</span><span class="comment">*</span><span class="comment"> K must satisfy 0 .le. K.
</span><span class="comment">*</span><span class="comment"> Unchanged on exit.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A - COMPLEX*16 array of DIMENSION ( LDA, n ).
</span><span class="comment">*</span><span class="comment"> Before entry with UPLO = 'U' or 'u', the leading ( k + 1 )
</span><span class="comment">*</span><span class="comment"> by n part of the array A must contain the upper triangular
</span><span class="comment">*</span><span class="comment"> band part of the matrix of coefficients, supplied column by
</span><span class="comment">*</span><span class="comment"> column, with the leading diagonal of the matrix in row
</span><span class="comment">*</span><span class="comment"> ( k + 1 ) of the array, the first super-diagonal starting at
</span><span class="comment">*</span><span class="comment"> position 2 in row k, and so on. The top left k by k triangle
</span><span class="comment">*</span><span class="comment"> of the array A is not referenced.
</span><span class="comment">*</span><span class="comment"> The following program segment will transfer an upper
</span><span class="comment">*</span><span class="comment"> triangular band matrix from conventional full matrix storage
</span><span class="comment">*</span><span class="comment"> to band storage:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DO 20, J = 1, N
</span><span class="comment">*</span><span class="comment"> M = K + 1 - J
</span><span class="comment">*</span><span class="comment"> DO 10, I = MAX( 1, J - K ), J
</span><span class="comment">*</span><span class="comment"> A( M + I, J ) = matrix( I, J )
</span><span class="comment">*</span><span class="comment"> 10 CONTINUE
</span><span class="comment">*</span><span class="comment"> 20 CONTINUE
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Before entry with UPLO = 'L' or 'l', the leading ( k + 1 )
</span><span class="comment">*</span><span class="comment"> by n part of the array A must contain the lower triangular
</span><span class="comment">*</span><span class="comment"> band part of the matrix of coefficients, supplied column by
</span><span class="comment">*</span><span class="comment"> column, with the leading diagonal of the matrix in row 1 of
</span><span class="comment">*</span><span class="comment"> the array, the first sub-diagonal starting at position 1 in
</span><span class="comment">*</span><span class="comment"> row 2, and so on. The bottom right k by k triangle of the
</span><span class="comment">*</span><span class="comment"> array A is not referenced.
</span><span class="comment">*</span><span class="comment"> The following program segment will transfer a lower
</span><span class="comment">*</span><span class="comment"> triangular band matrix from conventional full matrix storage
</span><span class="comment">*</span><span class="comment"> to band storage:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DO 20, J = 1, N
</span><span class="comment">*</span><span class="comment"> M = 1 - J
</span><span class="comment">*</span><span class="comment"> DO 10, I = J, MIN( N, J + K )
</span><span class="comment">*</span><span class="comment"> A( M + I, J ) = matrix( I, J )
</span><span class="comment">*</span><span class="comment"> 10 CONTINUE
</span><span class="comment">*</span><span class="comment"> 20 CONTINUE
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Note that when DIAG = 'U' or 'u' the elements of the array A
</span><span class="comment">*</span><span class="comment"> corresponding to the diagonal elements of the matrix are not
</span><span class="comment">*</span><span class="comment"> referenced, but are assumed to be unity.
</span><span class="comment">*</span><span class="comment"> Unchanged on exit.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDA - INTEGER.
</span><span class="comment">*</span><span class="comment"> On entry, LDA specifies the first dimension of A as declared
</span><span class="comment">*</span><span class="comment"> in the calling (sub) program. LDA must be at least
</span><span class="comment">*</span><span class="comment"> ( k + 1 ).
</span><span class="comment">*</span><span class="comment"> Unchanged on exit.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> X - COMPLEX*16 array of dimension at least
</span><span class="comment">*</span><span class="comment"> ( 1 + ( n - 1 )*abs( INCX ) ).
</span><span class="comment">*</span><span class="comment"> Before entry, the incremented array X must contain the n
</span><span class="comment">*</span><span class="comment"> element vector x. On exit, X is overwritten with the
</span><span class="comment">*</span><span class="comment"> tranformed vector x.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INCX - INTEGER.
</span><span class="comment">*</span><span class="comment"> On entry, INCX specifies the increment for the elements of
</span><span class="comment">*</span><span class="comment"> X. INCX must not be zero.
</span><span class="comment">*</span><span class="comment"> Unchanged on exit.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Level 2 Blas routine.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- Written on 22-October-1986.
</span><span class="comment">*</span><span class="comment"> Jack Dongarra, Argonne National Lab.
</span><span class="comment">*</span><span class="comment"> Jeremy Du Croz, Nag Central Office.
</span><span class="comment">*</span><span class="comment"> Sven Hammarling, Nag Central Office.
</span><span class="comment">*</span><span class="comment"> Richard Hanson, Sandia National Labs.
</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 COMPLEX ZERO
PARAMETER (ZERO= (0.0D+0,0.0D+0))
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> DOUBLE COMPLEX TEMP
INTEGER I,INFO,IX,J,JX,KPLUS1,KX,L
LOGICAL NOCONJ,NOUNIT
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.148"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
EXTERNAL <a name="LSAME.149"></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="XERBLA.152"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC DCONJG,MAX,MIN
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Test the input parameters.
</span><span class="comment">*</span><span class="comment">
</span> INFO = 0
IF (.NOT.<a name="LSAME.161"></a><a href="lsame.f.html#LSAME.1">LSAME</a>(UPLO,<span class="string">'U'</span>) .AND. .NOT.<a name="LSAME.161"></a><a href="lsame.f.html#LSAME.1">LSAME</a>(UPLO,<span class="string">'L'</span>)) THEN
INFO = 1
ELSE IF (.NOT.<a name="LSAME.163"></a><a href="lsame.f.html#LSAME.1">LSAME</a>(TRANS,<span class="string">'N'</span>) .AND. .NOT.<a name="LSAME.163"></a><a href="lsame.f.html#LSAME.1">LSAME</a>(TRANS,<span class="string">'T'</span>) .AND.
+ .NOT.<a name="LSAME.164"></a><a href="lsame.f.html#LSAME.1">LSAME</a>(TRANS,<span class="string">'C'</span>)) THEN
INFO = 2
ELSE IF (.NOT.<a name="LSAME.166"></a><a href="lsame.f.html#LSAME.1">LSAME</a>(DIAG,<span class="string">'U'</span>) .AND. .NOT.<a name="LSAME.166"></a><a href="lsame.f.html#LSAME.1">LSAME</a>(DIAG,<span class="string">'N'</span>)) THEN
INFO = 3
ELSE IF (N.LT.0) THEN
INFO = 4
ELSE IF (K.LT.0) THEN
INFO = 5
ELSE IF (LDA.LT. (K+1)) THEN
INFO = 7
ELSE IF (INCX.EQ.0) THEN
INFO = 9
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?