srotg.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 61 行
HTML
61 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>srotg.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.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="SROTG.1"></a><a href="srotg.f.html#SROTG.1">SROTG</a>(SA,SB,C,S)
<span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> REAL C,S,SA,SB
<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"> construct givens plane rotation.
</span><span class="comment">*</span><span class="comment"> jack dongarra, linpack, 3/11/78.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> REAL R,ROE,SCALE,Z
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC ABS,SIGN,SQRT
<span class="comment">*</span><span class="comment"> ..
</span> ROE = SB
IF (ABS(SA).GT.ABS(SB)) ROE = SA
SCALE = ABS(SA) + ABS(SB)
IF (SCALE.NE.0.0) GO TO 10
C = 1.0
S = 0.0
R = 0.0
Z = 0.0
GO TO 20
10 R = SCALE*SQRT((SA/SCALE)**2+ (SB/SCALE)**2)
R = SIGN(1.0,ROE)*R
C = SA/R
S = SB/R
Z = 1.0
IF (ABS(SA).GT.ABS(SB)) Z = S
IF (ABS(SB).GE.ABS(SA) .AND. C.NE.0.0) Z = 1.0/C
20 SA = R
SB = Z
RETURN
END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?