LAPACK 3.3.1
Linear Algebra PACKage

srot.f

Go to the documentation of this file.
00001       SUBROUTINE SROT(N,SX,INCX,SY,INCY,C,S)
00002 *     .. Scalar Arguments ..
00003       REAL C,S
00004       INTEGER INCX,INCY,N
00005 *     ..
00006 *     .. Array Arguments ..
00007       REAL SX(*),SY(*)
00008 *     ..
00009 *
00010 *  Purpose
00011 *  =======
00012 *
00013 *     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       REAL STEMP
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             STEMP = C*SX(I) + S*SY(I)
00034             SY(I) = C*SY(I) - S*SX(I)
00035             SX(I) = STEMP
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             STEMP = C*SX(IX) + S*SY(IY)
00048             SY(IY) = C*SY(IY) - S*SX(IX)
00049             SX(IX) = STEMP
00050             IX = IX + INCX
00051             IY = IY + INCY
00052          END DO
00053       END IF
00054       RETURN
00055       END
 All Files Functions