LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zlacrt()

subroutine zlacrt ( integer  N,
complex*16, dimension( * )  CX,
integer  INCX,
complex*16, dimension( * )  CY,
integer  INCY,
complex*16  C,
complex*16  S 
)

ZLACRT performs a linear transformation of a pair of complex vectors.

Download ZLACRT + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 ZLACRT performs the operation

    (  c  s )( x )  ==> ( x )
    ( -s  c )( y )      ( y )

 where c and s are complex and the vectors x and y are complex.
Parameters
[in]N
          N is INTEGER
          The number of elements in the vectors CX and CY.
[in,out]CX
          CX is COMPLEX*16 array, dimension (N)
          On input, the vector x.
          On output, CX is overwritten with c*x + s*y.
[in]INCX
          INCX is INTEGER
          The increment between successive values of CX.  INCX <> 0.
[in,out]CY
          CY is COMPLEX*16 array, dimension (N)
          On input, the vector y.
          On output, CY is overwritten with -s*x + c*y.
[in]INCY
          INCY is INTEGER
          The increment between successive values of CY.  INCY <> 0.
[in]C
          C is COMPLEX*16
[in]S
          S is COMPLEX*16
          C and S define the matrix
             [  C   S  ].
             [ -S   C  ]
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 107 of file zlacrt.f.

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