zlacrt.f.html

来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 113 行

HTML
113
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>zlacrt.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="ZLACRT.1"></a><a href="zlacrt.f.html#ZLACRT.1">ZLACRT</a>( N, CX, INCX, CY, INCY, C, S )
<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>      INTEGER            INCX, INCY, N
      COMPLEX*16         C, S
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      COMPLEX*16         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">  <a name="ZLACRT.18"></a><a href="zlacrt.f.html#ZLACRT.1">ZLACRT</a> performs the operation
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     (  c  s )( x )  ==&gt; ( x )
</span><span class="comment">*</span><span class="comment">     ( -s  c )( y )      ( y )
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  where c and s are complex and the vectors x and y are complex.
</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">          The number of elements in the vectors CX and CY.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  CX      (input/output) COMPLEX*16 array, dimension (N)
</span><span class="comment">*</span><span class="comment">          On input, the vector x.
</span><span class="comment">*</span><span class="comment">          On output, CX is overwritten with c*x + s*y.
</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">          The increment between successive values of CX.  INCX &lt;&gt; 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  CY      (input/output) COMPLEX*16 array, dimension (N)
</span><span class="comment">*</span><span class="comment">          On input, the vector y.
</span><span class="comment">*</span><span class="comment">          On output, CY is overwritten with -s*x + c*y.
</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">          The increment between successive values of CY.  INCY &lt;&gt; 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  C       (input) COMPLEX*16
</span><span class="comment">*</span><span class="comment">  S       (input) COMPLEX*16
</span><span class="comment">*</span><span class="comment">          C and S define the matrix
</span><span class="comment">*</span><span class="comment">             [  C   S  ].
</span><span class="comment">*</span><span class="comment">             [ -S   C  ]
</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*16         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 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 CONTINUE
      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 + -
显示快捷键?