LAPACK 3.3.0

zlar2v.f

Go to the documentation of this file.
00001       SUBROUTINE ZLAR2V( N, X, Y, Z, INCX, C, S, INCC )
00002 *
00003 *  -- LAPACK auxiliary routine (version 3.2) --
00004 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00005 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00006 *     November 2006
00007 *
00008 *     .. Scalar Arguments ..
00009       INTEGER            INCC, INCX, N
00010 *     ..
00011 *     .. Array Arguments ..
00012       DOUBLE PRECISION   C( * )
00013       COMPLEX*16         S( * ), X( * ), Y( * ), Z( * )
00014 *     ..
00015 *
00016 *  Purpose
00017 *  =======
00018 *
00019 *  ZLAR2V applies a vector of complex plane rotations with real cosines
00020 *  from both sides to a sequence of 2-by-2 complex Hermitian matrices,
00021 *  defined by the elements of the vectors x, y and z. For i = 1,2,...,n
00022 *
00023 *     (       x(i)  z(i) ) :=
00024 *     ( conjg(z(i)) y(i) )
00025 *
00026 *       (  c(i) conjg(s(i)) ) (       x(i)  z(i) ) ( c(i) -conjg(s(i)) )
00027 *       ( -s(i)       c(i)  ) ( conjg(z(i)) y(i) ) ( s(i)        c(i)  )
00028 *
00029 *  Arguments
00030 *  =========
00031 *
00032 *  N       (input) INTEGER
00033 *          The number of plane rotations to be applied.
00034 *
00035 *  X       (input/output) COMPLEX*16 array, dimension (1+(N-1)*INCX)
00036 *          The vector x; the elements of x are assumed to be real.
00037 *
00038 *  Y       (input/output) COMPLEX*16 array, dimension (1+(N-1)*INCX)
00039 *          The vector y; the elements of y are assumed to be real.
00040 *
00041 *  Z       (input/output) COMPLEX*16 array, dimension (1+(N-1)*INCX)
00042 *          The vector z.
00043 *
00044 *  INCX    (input) INTEGER
00045 *          The increment between elements of X, Y and Z. INCX > 0.
00046 *
00047 *  C       (input) DOUBLE PRECISION array, dimension (1+(N-1)*INCC)
00048 *          The cosines of the plane rotations.
00049 *
00050 *  S       (input) COMPLEX*16 array, dimension (1+(N-1)*INCC)
00051 *          The sines of the plane rotations.
00052 *
00053 *  INCC    (input) INTEGER
00054 *          The increment between elements of C and S. INCC > 0.
00055 *
00056 *  =====================================================================
00057 *
00058 *     .. Local Scalars ..
00059       INTEGER            I, IC, IX
00060       DOUBLE PRECISION   CI, SII, SIR, T1I, T1R, T5, T6, XI, YI, ZII,
00061      $                   ZIR
00062       COMPLEX*16         SI, T2, T3, T4, ZI
00063 *     ..
00064 *     .. Intrinsic Functions ..
00065       INTRINSIC          DBLE, DCMPLX, DCONJG, DIMAG
00066 *     ..
00067 *     .. Executable Statements ..
00068 *
00069       IX = 1
00070       IC = 1
00071       DO 10 I = 1, N
00072          XI = DBLE( X( IX ) )
00073          YI = DBLE( Y( IX ) )
00074          ZI = Z( IX )
00075          ZIR = DBLE( ZI )
00076          ZII = DIMAG( ZI )
00077          CI = C( IC )
00078          SI = S( IC )
00079          SIR = DBLE( SI )
00080          SII = DIMAG( SI )
00081          T1R = SIR*ZIR - SII*ZII
00082          T1I = SIR*ZII + SII*ZIR
00083          T2 = CI*ZI
00084          T3 = T2 - DCONJG( SI )*XI
00085          T4 = DCONJG( T2 ) + SI*YI
00086          T5 = CI*XI + T1R
00087          T6 = CI*YI - T1R
00088          X( IX ) = CI*T5 + ( SIR*DBLE( T4 )+SII*DIMAG( T4 ) )
00089          Y( IX ) = CI*T6 - ( SIR*DBLE( T3 )-SII*DIMAG( T3 ) )
00090          Z( IX ) = CI*T3 + DCONJG( SI )*DCMPLX( T6, T1I )
00091          IX = IX + INCX
00092          IC = IC + INCC
00093    10 CONTINUE
00094       RETURN
00095 *
00096 *     End of ZLAR2V
00097 *
00098       END
 All Files Functions