You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

zlacrt.f 4.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. *> \brief \b ZLACRT performs a linear transformation of a pair of complex vectors.
  2. *
  3. * =========== DOCUMENTATION ===========
  4. *
  5. * Online html documentation available at
  6. * http://www.netlib.org/lapack/explore-html/
  7. *
  8. *> \htmlonly
  9. *> Download ZLACRT + dependencies
  10. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlacrt.f">
  11. *> [TGZ]</a>
  12. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlacrt.f">
  13. *> [ZIP]</a>
  14. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlacrt.f">
  15. *> [TXT]</a>
  16. *> \endhtmlonly
  17. *
  18. * Definition:
  19. * ===========
  20. *
  21. * SUBROUTINE ZLACRT( N, CX, INCX, CY, INCY, C, S )
  22. *
  23. * .. Scalar Arguments ..
  24. * INTEGER INCX, INCY, N
  25. * COMPLEX*16 C, S
  26. * ..
  27. * .. Array Arguments ..
  28. * COMPLEX*16 CX( * ), CY( * )
  29. * ..
  30. *
  31. *
  32. *> \par Purpose:
  33. * =============
  34. *>
  35. *> \verbatim
  36. *>
  37. *> ZLACRT performs the operation
  38. *>
  39. *> ( c s )( x ) ==> ( x )
  40. *> ( -s c )( y ) ( y )
  41. *>
  42. *> where c and s are complex and the vectors x and y are complex.
  43. *> \endverbatim
  44. *
  45. * Arguments:
  46. * ==========
  47. *
  48. *> \param[in] N
  49. *> \verbatim
  50. *> N is INTEGER
  51. *> The number of elements in the vectors CX and CY.
  52. *> \endverbatim
  53. *>
  54. *> \param[in,out] CX
  55. *> \verbatim
  56. *> CX is COMPLEX*16 array, dimension (N)
  57. *> On input, the vector x.
  58. *> On output, CX is overwritten with c*x + s*y.
  59. *> \endverbatim
  60. *>
  61. *> \param[in] INCX
  62. *> \verbatim
  63. *> INCX is INTEGER
  64. *> The increment between successive values of CX. INCX <> 0.
  65. *> \endverbatim
  66. *>
  67. *> \param[in,out] CY
  68. *> \verbatim
  69. *> CY is COMPLEX*16 array, dimension (N)
  70. *> On input, the vector y.
  71. *> On output, CY is overwritten with -s*x + c*y.
  72. *> \endverbatim
  73. *>
  74. *> \param[in] INCY
  75. *> \verbatim
  76. *> INCY is INTEGER
  77. *> The increment between successive values of CY. INCY <> 0.
  78. *> \endverbatim
  79. *>
  80. *> \param[in] C
  81. *> \verbatim
  82. *> C is COMPLEX*16
  83. *> \endverbatim
  84. *>
  85. *> \param[in] S
  86. *> \verbatim
  87. *> S is COMPLEX*16
  88. *> C and S define the matrix
  89. *> [ C S ].
  90. *> [ -S C ]
  91. *> \endverbatim
  92. *
  93. * Authors:
  94. * ========
  95. *
  96. *> \author Univ. of Tennessee
  97. *> \author Univ. of California Berkeley
  98. *> \author Univ. of Colorado Denver
  99. *> \author NAG Ltd.
  100. *
  101. *> \date December 2016
  102. *
  103. *> \ingroup complex16OTHERauxiliary
  104. *
  105. * =====================================================================
  106. SUBROUTINE ZLACRT( N, CX, INCX, CY, INCY, C, S )
  107. *
  108. * -- LAPACK auxiliary routine (version 3.7.0) --
  109. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  110. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  111. * December 2016
  112. *
  113. * .. Scalar Arguments ..
  114. INTEGER INCX, INCY, N
  115. COMPLEX*16 C, S
  116. * ..
  117. * .. Array Arguments ..
  118. COMPLEX*16 CX( * ), CY( * )
  119. * ..
  120. *
  121. * =====================================================================
  122. *
  123. * .. Local Scalars ..
  124. INTEGER I, IX, IY
  125. COMPLEX*16 CTEMP
  126. * ..
  127. * .. Executable Statements ..
  128. *
  129. IF( N.LE.0 )
  130. $ RETURN
  131. IF( INCX.EQ.1 .AND. INCY.EQ.1 )
  132. $ GO TO 20
  133. *
  134. * Code for unequal increments or equal increments not equal to 1
  135. *
  136. IX = 1
  137. IY = 1
  138. IF( INCX.LT.0 )
  139. $ IX = ( -N+1 )*INCX + 1
  140. IF( INCY.LT.0 )
  141. $ IY = ( -N+1 )*INCY + 1
  142. DO 10 I = 1, N
  143. CTEMP = C*CX( IX ) + S*CY( IY )
  144. CY( IY ) = C*CY( IY ) - S*CX( IX )
  145. CX( IX ) = CTEMP
  146. IX = IX + INCX
  147. IY = IY + INCY
  148. 10 CONTINUE
  149. RETURN
  150. *
  151. * Code for both increments equal to 1
  152. *
  153. 20 CONTINUE
  154. DO 30 I = 1, N
  155. CTEMP = C*CX( I ) + S*CY( I )
  156. CY( I ) = C*CY( I ) - S*CX( I )
  157. CX( I ) = CTEMP
  158. 30 CONTINUE
  159. RETURN
  160. END