zlaqhp.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 171 行
HTML
171 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>zlaqhp.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="ZLAQHP.1"></a><a href="zlaqhp.f.html#ZLAQHP.1">ZLAQHP</a>( UPLO, N, AP, S, SCOND, AMAX, EQUED )
<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 EQUED, UPLO
INTEGER N
DOUBLE PRECISION AMAX, SCOND
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> DOUBLE PRECISION S( * )
COMPLEX*16 AP( * )
<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="ZLAQHP.20"></a><a href="zlaqhp.f.html#ZLAQHP.1">ZLAQHP</a> equilibrates a Hermitian matrix A using the scaling factors
</span><span class="comment">*</span><span class="comment"> in the vector S.
</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 (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> Specifies whether the upper or lower triangular part of the
</span><span class="comment">*</span><span class="comment"> Hermitian matrix A is stored.
</span><span class="comment">*</span><span class="comment"> = 'U': Upper triangular
</span><span class="comment">*</span><span class="comment"> = 'L': Lower triangular
</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.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> AP (input/output) COMPLEX*16 array, dimension (N*(N+1)/2)
</span><span class="comment">*</span><span class="comment"> On entry, the upper or lower triangle of the Hermitian matrix
</span><span class="comment">*</span><span class="comment"> A, packed columnwise in a linear array. The j-th column of A
</span><span class="comment">*</span><span class="comment"> is stored in the array AP as follows:
</span><span class="comment">*</span><span class="comment"> if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
</span><span class="comment">*</span><span class="comment"> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> On exit, the equilibrated matrix: diag(S) * A * diag(S), in
</span><span class="comment">*</span><span class="comment"> the same storage format as A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> S (input) DOUBLE PRECISION array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The scale factors for A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SCOND (input) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment"> Ratio of the smallest S(i) to the largest S(i).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> AMAX (input) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment"> Absolute value of largest matrix entry.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> EQUED (output) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> Specifies whether or not equilibration was done.
</span><span class="comment">*</span><span class="comment"> = 'N': No equilibration.
</span><span class="comment">*</span><span class="comment"> = 'Y': Equilibration was done, i.e., A has been replaced by
</span><span class="comment">*</span><span class="comment"> diag(S) * A * diag(S).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Internal Parameters
</span><span class="comment">*</span><span class="comment"> ===================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> THRESH is a threshold value used to decide if scaling should be done
</span><span class="comment">*</span><span class="comment"> based on the ratio of the scaling factors. If SCOND < THRESH,
</span><span class="comment">*</span><span class="comment"> scaling is done.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LARGE and SMALL are threshold values used to decide if scaling should
</span><span class="comment">*</span><span class="comment"> be done based on the absolute size of the largest matrix element.
</span><span class="comment">*</span><span class="comment"> If AMAX > LARGE or AMAX < SMALL, scaling is done.
</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, THRESH
PARAMETER ( ONE = 1.0D+0, THRESH = 0.1D+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> INTEGER I, J, JC
DOUBLE PRECISION CJ, LARGE, SMALL
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.82"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
DOUBLE PRECISION <a name="DLAMCH.83"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>
EXTERNAL <a name="LSAME.84"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="DLAMCH.84"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC DBLE
<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><span class="comment">*</span><span class="comment"> Quick return if possible
</span><span class="comment">*</span><span class="comment">
</span> IF( N.LE.0 ) THEN
EQUED = <span class="string">'N'</span>
RETURN
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Initialize LARGE and SMALL.
</span><span class="comment">*</span><span class="comment">
</span> SMALL = <a name="DLAMCH.100"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>( <span class="string">'Safe minimum'</span> ) / <a name="DLAMCH.100"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>( <span class="string">'Precision'</span> )
LARGE = ONE / SMALL
<span class="comment">*</span><span class="comment">
</span> IF( SCOND.GE.THRESH .AND. AMAX.GE.SMALL .AND. AMAX.LE.LARGE ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> No equilibration
</span><span class="comment">*</span><span class="comment">
</span> EQUED = <span class="string">'N'</span>
ELSE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Replace A by diag(S) * A * diag(S).
</span><span class="comment">*</span><span class="comment">
</span> IF( <a name="LSAME.112"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'U'</span> ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Upper triangle of A is stored.
</span><span class="comment">*</span><span class="comment">
</span> JC = 1
DO 20 J = 1, N
CJ = S( J )
DO 10 I = 1, J - 1
AP( JC+I-1 ) = CJ*S( I )*AP( JC+I-1 )
10 CONTINUE
AP( JC+J-1 ) = CJ*CJ*DBLE( AP( JC+J-1 ) )
JC = JC + J
20 CONTINUE
ELSE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Lower triangle of A is stored.
</span><span class="comment">*</span><span class="comment">
</span> JC = 1
DO 40 J = 1, N
CJ = S( J )
AP( JC ) = CJ*CJ*DBLE( AP( JC ) )
DO 30 I = J + 1, N
AP( JC+I-J ) = CJ*S( I )*AP( JC+I-J )
30 CONTINUE
JC = JC + N - J + 1
40 CONTINUE
END IF
EQUED = <span class="string">'Y'</span>
END IF
<span class="comment">*</span><span class="comment">
</span> RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> End of <a name="ZLAQHP.144"></a><a href="zlaqhp.f.html#ZLAQHP.1">ZLAQHP</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?