LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
zdrot.f
Go to the documentation of this file.
00001 *> \brief \b ZDROT
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *  Definition:
00009 *  ===========
00010 *
00011 *       SUBROUTINE ZDROT( N, CX, INCX, CY, INCY, C, S )
00012 * 
00013 *       .. Scalar Arguments ..
00014 *       INTEGER            INCX, INCY, N
00015 *       DOUBLE PRECISION   C, S
00016 *       ..
00017 *       .. Array Arguments ..
00018 *       COMPLEX*16         CX( * ), CY( * )
00019 *       ..
00020 *  
00021 *
00022 *> \par Purpose:
00023 *  =============
00024 *>
00025 *> \verbatim
00026 *>
00027 *> Applies a plane rotation, where the cos and sin (c and s) are real
00028 *> and the vectors cx and cy are complex.
00029 *> jack dongarra, linpack, 3/11/78.
00030 *> \endverbatim
00031 *
00032 *  Arguments:
00033 *  ==========
00034 *
00035 *> \param[in] N
00036 *> \verbatim
00037 *>          N is INTEGER
00038 *>           On entry, N specifies the order of the vectors cx and cy.
00039 *>           N must be at least zero.
00040 *> \endverbatim
00041 *>
00042 *> \param[in,out] CX
00043 *> \verbatim
00044 *>          CX is COMPLEX*16 array, dimension at least
00045 *>           ( 1 + ( N - 1 )*abs( INCX ) ).
00046 *>           Before entry, the incremented array CX must contain the n
00047 *>           element vector cx. On exit, CX is overwritten by the updated
00048 *>           vector cx.
00049 *> \endverbatim
00050 *>
00051 *> \param[in] INCX
00052 *> \verbatim
00053 *>          INCX is INTEGER
00054 *>           On entry, INCX specifies the increment for the elements of
00055 *>           CX. INCX must not be zero.
00056 *> \endverbatim
00057 *>
00058 *> \param[in,out] CY
00059 *> \verbatim
00060 *>          CY is COMPLEX*16 array, dimension at least
00061 *>           ( 1 + ( N - 1 )*abs( INCY ) ).
00062 *>           Before entry, the incremented array CY must contain the n
00063 *>           element vector cy. On exit, CY is overwritten by the updated
00064 *>           vector cy.
00065 *> \endverbatim
00066 *>
00067 *> \param[in] INCY
00068 *> \verbatim
00069 *>          INCY is INTEGER
00070 *>           On entry, INCY specifies the increment for the elements of
00071 *>           CY. INCY must not be zero.
00072 *> \endverbatim
00073 *>
00074 *> \param[in] C
00075 *> \verbatim
00076 *>          C is DOUBLE PRECISION
00077 *>           On entry, C specifies the cosine, cos.
00078 *> \endverbatim
00079 *>
00080 *> \param[in] S
00081 *> \verbatim
00082 *>          S is DOUBLE PRECISION
00083 *>           On entry, S specifies the sine, sin.
00084 *> \endverbatim
00085 *
00086 *  Authors:
00087 *  ========
00088 *
00089 *> \author Univ. of Tennessee 
00090 *> \author Univ. of California Berkeley 
00091 *> \author Univ. of Colorado Denver 
00092 *> \author NAG Ltd. 
00093 *
00094 *> \date November 2011
00095 *
00096 *> \ingroup complex16_blas_level1
00097 *
00098 *  =====================================================================
00099       SUBROUTINE ZDROT( N, CX, INCX, CY, INCY, C, S )
00100 *
00101 *  -- Reference BLAS level1 routine (version 3.4.0) --
00102 *  -- Reference BLAS is a software package provided by Univ. of Tennessee,    --
00103 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00104 *     November 2011
00105 *
00106 *     .. Scalar Arguments ..
00107       INTEGER            INCX, INCY, N
00108       DOUBLE PRECISION   C, S
00109 *     ..
00110 *     .. Array Arguments ..
00111       COMPLEX*16         CX( * ), CY( * )
00112 *     ..
00113 *
00114 * =====================================================================
00115 *
00116 *     .. Local Scalars ..
00117       INTEGER            I, IX, IY
00118       COMPLEX*16         CTEMP
00119 *     ..
00120 *     .. Executable Statements ..
00121 *
00122       IF( N.LE.0 )
00123      $   RETURN
00124       IF( INCX.EQ.1 .AND. INCY.EQ.1 ) THEN
00125 *
00126 *        code for both increments equal to 1
00127 *
00128          DO I = 1, N
00129             CTEMP = C*CX( I ) + S*CY( I )
00130             CY( I ) = C*CY( I ) - S*CX( I )
00131             CX( I ) = CTEMP
00132          END DO
00133       ELSE
00134 *
00135 *        code for unequal increments or equal increments not equal
00136 *          to 1
00137 *
00138          IX = 1
00139          IY = 1
00140          IF( INCX.LT.0 )
00141      $      IX = ( -N+1 )*INCX + 1
00142          IF( INCY.LT.0 )
00143      $      IY = ( -N+1 )*INCY + 1
00144          DO I = 1, N
00145             CTEMP = C*CX( IX ) + S*CY( IY )
00146             CY( IY ) = C*CY( IY ) - S*CX( IX )
00147             CX( IX ) = CTEMP
00148             IX = IX + INCX
00149             IY = IY + INCY
00150          END DO
00151       END IF
00152       RETURN
00153       END
 All Files Functions