LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ clacrt()

subroutine clacrt ( integer n,
complex, dimension( * ) cx,
integer incx,
complex, dimension( * ) cy,
integer incy,
complex c,
complex s )

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

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

Purpose:
!>
!> CLACRT 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 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 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
!> 
[in]S
!>          S is COMPLEX
!>          C and S define the matrix
!>             [  C   S  ].
!>             [ -S   C  ]
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 102 of file clacrt.f.

103*
104* -- LAPACK auxiliary routine --
105* -- LAPACK is a software package provided by Univ. of Tennessee, --
106* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
107*
108* .. Scalar Arguments ..
109 INTEGER INCX, INCY, N
110 COMPLEX C, S
111* ..
112* .. Array Arguments ..
113 COMPLEX CX( * ), CY( * )
114* ..
115*
116* =====================================================================
117*
118* .. Local Scalars ..
119 INTEGER I, IX, IY
120 COMPLEX CTEMP
121* ..
122* .. Executable Statements ..
123*
124 IF( n.LE.0 )
125 $ RETURN
126 IF( incx.EQ.1 .AND. incy.EQ.1 )
127 $ GO TO 20
128*
129* Code for unequal increments or equal increments not equal to 1
130*
131 ix = 1
132 iy = 1
133 IF( incx.LT.0 )
134 $ ix = ( -n+1 )*incx + 1
135 IF( incy.LT.0 )
136 $ iy = ( -n+1 )*incy + 1
137 DO 10 i = 1, n
138 ctemp = c*cx( ix ) + s*cy( iy )
139 cy( iy ) = c*cy( iy ) - s*cx( ix )
140 cx( ix ) = ctemp
141 ix = ix + incx
142 iy = iy + incy
143 10 CONTINUE
144 RETURN
145*
146* Code for both increments equal to 1
147*
148 20 CONTINUE
149 DO 30 i = 1, n
150 ctemp = c*cx( i ) + s*cy( i )
151 cy( i ) = c*cy( i ) - s*cx( i )
152 cx( i ) = ctemp
153 30 CONTINUE
154 RETURN