csrot.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 118 行
HTML
118 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>csrot.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="CSROT.1"></a><a href="csrot.f.html#CSROT.1">CSROT</a>( N, CX, INCX, CY, INCY, C, S )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> INTEGER INCX, INCY, N
REAL C, S
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> COMPLEX CX( * ), CY( * )
<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"> Applies a plane rotation, where the cos and sin (c and s) are real
</span><span class="comment">*</span><span class="comment"> and the vectors cx and cy are complex.
</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"> 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"> N (input) INTEGER
</span><span class="comment">*</span><span class="comment"> On entry, N specifies the order of the vectors cx and cy.
</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"> CX (input) COMPLEX array, 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 CX must contain the n
</span><span class="comment">*</span><span class="comment"> element vector cx. On exit, CX is overwritten by the updated
</span><span class="comment">*</span><span class="comment"> vector cx.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INCX (input) 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"> CX. 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"> CY (input) COMPLEX array, dimension at least
</span><span class="comment">*</span><span class="comment"> ( 1 + ( N - 1 )*abs( INCY ) ).
</span><span class="comment">*</span><span class="comment"> Before entry, the incremented array CY must contain the n
</span><span class="comment">*</span><span class="comment"> element vector cy. On exit, CY is overwritten by the updated
</span><span class="comment">*</span><span class="comment"> vector cy.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INCY (input) INTEGER
</span><span class="comment">*</span><span class="comment"> On entry, INCY specifies the increment for the elements of
</span><span class="comment">*</span><span class="comment"> CY. INCY 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"> C (input) REAL
</span><span class="comment">*</span><span class="comment"> On entry, C specifies the cosine, cos.
</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"> S (input) REAL
</span><span class="comment">*</span><span class="comment"> On entry, S specifies the sine, sin.
</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">
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> INTEGER I, IX, IY
COMPLEX CTEMP
<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 )
$ RETURN
IF( INCX.EQ.1 .AND. INCY.EQ.1 )
$ GO TO 20
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> code for unequal increments or equal increments not equal
</span><span class="comment">*</span><span class="comment"> to 1
</span><span class="comment">*</span><span class="comment">
</span> IX = 1
IY = 1
IF( INCX.LT.0 )
$ IX = ( -N+1 )*INCX + 1
IF( INCY.LT.0 )
$ IY = ( -N+1 )*INCY + 1
DO 10 I = 1, N
CTEMP = C*CX( IX ) + S*CY( IY )
CY( IY ) = C*CY( IY ) - S*CX( IX )
CX( IX ) = CTEMP
IX = IX + INCX
IY = IY + INCY
10 CONTINUE
RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> code for both increments equal to 1
</span><span class="comment">*</span><span class="comment">
</span> 20 DO 30 I = 1, N
CTEMP = C*CX( I ) + S*CY( I )
CY( I ) = C*CY( I ) - S*CX( I )
CX( I ) = CTEMP
30 CONTINUE
RETURN
END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?