LAPACK 3.3.1 Linear Algebra PACKage

# drot.f

Go to the documentation of this file.
```00001       SUBROUTINE DROT(N,DX,INCX,DY,INCY,C,S)
00002 *     .. Scalar Arguments ..
00003       DOUBLE PRECISION C,S
00004       INTEGER INCX,INCY,N
00005 *     ..
00006 *     .. Array Arguments ..
00007       DOUBLE PRECISION DX(*),DY(*)
00008 *     ..
00009 *
00010 *  Purpose
00011 *  =======
00012 *
00013 *     DROT applies a plane rotation.
00014 *
00015 *  Further Details
00016 *  ===============
00017 *
00018 *     jack dongarra, linpack, 3/11/78.
00019 *     modified 12/3/93, array(1) declarations changed to array(*)
00020 *
00021 *  =====================================================================
00022 *
00023 *     .. Local Scalars ..
00024       DOUBLE PRECISION DTEMP
00025       INTEGER I,IX,IY
00026 *     ..
00027       IF (N.LE.0) RETURN
00028       IF (INCX.EQ.1 .AND. INCY.EQ.1) THEN
00029 *
00030 *       code for both increments equal to 1
00031 *
00032          DO I = 1,N
00033             DTEMP = C*DX(I) + S*DY(I)
00034             DY(I) = C*DY(I) - S*DX(I)
00035             DX(I) = DTEMP
00036          END DO
00037       ELSE
00038 *
00039 *       code for unequal increments or equal increments not equal
00040 *         to 1
00041 *
00042          IX = 1
00043          IY = 1
00044          IF (INCX.LT.0) IX = (-N+1)*INCX + 1
00045          IF (INCY.LT.0) IY = (-N+1)*INCY + 1
00046          DO I = 1,N
00047             DTEMP = C*DX(IX) + S*DY(IY)
00048             DY(IY) = C*DY(IY) - S*DX(IX)
00049             DX(IX) = DTEMP
00050             IX = IX + INCX
00051             IY = IY + INCY
00052          END DO
00053       END IF
00054       RETURN
00055       END
```