slauu2.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 160 行
HTML
160 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>slauu2.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="SLAUU2.1"></a><a href="slauu2.f.html#SLAUU2.1">SLAUU2</a>( UPLO, N, A, LDA, INFO )
<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 UPLO
INTEGER INFO, LDA, N
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> REAL A( LDA, * )
<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="SLAUU2.18"></a><a href="slauu2.f.html#SLAUU2.1">SLAUU2</a> computes the product U * U' or L' * L, where the triangular
</span><span class="comment">*</span><span class="comment"> factor U or L is stored in the upper or lower triangular part of
</span><span class="comment">*</span><span class="comment"> the array A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If UPLO = 'U' or 'u' then the upper triangle of the result is stored,
</span><span class="comment">*</span><span class="comment"> overwriting the factor U in A.
</span><span class="comment">*</span><span class="comment"> If UPLO = 'L' or 'l' then the lower triangle of the result is stored,
</span><span class="comment">*</span><span class="comment"> overwriting the factor L in A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> This is the unblocked form of the algorithm, calling Level 2 BLAS.
</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 triangular factor stored in the array A
</span><span class="comment">*</span><span class="comment"> is upper or lower triangular:
</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 triangular factor U or L. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A (input/output) REAL array, dimension (LDA,N)
</span><span class="comment">*</span><span class="comment"> On entry, the triangular factor U or L.
</span><span class="comment">*</span><span class="comment"> On exit, if UPLO = 'U', the upper triangle of A is
</span><span class="comment">*</span><span class="comment"> overwritten with the upper triangle of the product U * U';
</span><span class="comment">*</span><span class="comment"> if UPLO = 'L', the lower triangle of A is overwritten with
</span><span class="comment">*</span><span class="comment"> the lower triangle of the product L' * L.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDA (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array A. LDA >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INFO (output) INTEGER
</span><span class="comment">*</span><span class="comment"> = 0: successful exit
</span><span class="comment">*</span><span class="comment"> < 0: if INFO = -k, the k-th argument had an illegal value
</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> REAL ONE
PARAMETER ( ONE = 1.0E+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> LOGICAL UPPER
INTEGER I
REAL AII
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.67"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
REAL SDOT
EXTERNAL <a name="LSAME.69"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, SDOT
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL SGEMV, SSCAL, <a name="XERBLA.72"></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 MAX
<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"> Test the input parameters.
</span><span class="comment">*</span><span class="comment">
</span> INFO = 0
UPPER = <a name="LSAME.82"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'U'</span> )
IF( .NOT.UPPER .AND. .NOT.<a name="LSAME.83"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'L'</span> ) ) THEN
INFO = -1
ELSE IF( N.LT.0 ) THEN
INFO = -2
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -4
END IF
IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.91"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="SLAUU2.91"></a><a href="slauu2.f.html#SLAUU2.1">SLAUU2</a>'</span>, -INFO )
RETURN
END IF
<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.EQ.0 )
$ RETURN
<span class="comment">*</span><span class="comment">
</span> IF( UPPER ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Compute the product U * U'.
</span><span class="comment">*</span><span class="comment">
</span> DO 10 I = 1, N
AII = A( I, I )
IF( I.LT.N ) THEN
A( I, I ) = SDOT( N-I+1, A( I, I ), LDA, A( I, I ), LDA )
CALL SGEMV( <span class="string">'No transpose'</span>, I-1, N-I, ONE, A( 1, I+1 ),
$ LDA, A( I, I+1 ), LDA, AII, A( 1, I ), 1 )
ELSE
CALL SSCAL( I, AII, A( 1, I ), 1 )
END IF
10 CONTINUE
<span class="comment">*</span><span class="comment">
</span> ELSE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Compute the product L' * L.
</span><span class="comment">*</span><span class="comment">
</span> DO 20 I = 1, N
AII = A( I, I )
IF( I.LT.N ) THEN
A( I, I ) = SDOT( N-I+1, A( I, I ), 1, A( I, I ), 1 )
CALL SGEMV( <span class="string">'Transpose'</span>, N-I, I-1, ONE, A( I+1, 1 ), LDA,
$ A( I+1, I ), 1, AII, A( I, 1 ), LDA )
ELSE
CALL SSCAL( I, AII, A( I, 1 ), LDA )
END IF
20 CONTINUE
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="SLAUU2.133"></a><a href="slauu2.f.html#SLAUU2.1">SLAUU2</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?