2
SUBROUTINE SROT (N, SX, INCX, SY, INCY, SC, SS)
3
C***BEGIN PROLOGUE SROT
4
C***PURPOSE Apply a plane Givens rotation.
5
C***LIBRARY SLATEC (BLAS)
7
C***TYPE SINGLE PRECISION (SROT-S, DROT-D, CSROT-C)
8
C***KEYWORDS BLAS, GIVENS ROTATION, GIVENS TRANSFORMATION,
9
C LINEAR ALGEBRA, PLANE ROTATION, VECTOR
10
C***AUTHOR Lawson, C. L., (JPL)
11
C Hanson, R. J., (SNLA)
12
C Kincaid, D. R., (U. of Texas)
17
C Description of Parameters
20
C N number of elements in input vector(s)
21
C SX single precision vector with N elements
22
C INCX storage spacing between elements of SX
23
C SY single precision vector with N elements
24
C INCY storage spacing between elements of SY
25
C SC element of rotation matrix
26
C SS element of rotation matrix
29
C SX rotated vector SX (unchanged if N .LE. 0)
30
C SY rotated vector SY (unchanged if N .LE. 0)
32
C Multiply the 2 x 2 matrix ( SC SS) times the 2 x N matrix (SX**T)
34
C where **T indicates transpose. The elements of SX are in
35
C SX(LX+I*INCX), I = 0 to N-1, where LX = 1 if INCX .GE. 0, else
36
C LX = 1+(1-N)*INCX, and similarly for SY using LY and INCY.
38
C***REFERENCES C. L. Lawson, R. J. Hanson, D. R. Kincaid and F. T.
39
C Krogh, Basic linear algebra subprograms for Fortran
40
C usage, Algorithm No. 539, Transactions on Mathematical
41
C Software 5, 3 (September 1979), pp. 308-323.
42
C***ROUTINES CALLED (NONE)
43
C***REVISION HISTORY (YYMMDD)
45
C 861211 REVISION DATE from Version 3.2
46
C 891214 Prologue converted to Version 4.0 format. (BAB)
47
C 920310 Corrected definition of LX in DESCRIPTION. (WRB)
48
C 920501 Reformatted the REFERENCES section. (WRB)
50
REAL SX, SY, SC, SS, ZERO, ONE, W, Z
51
DIMENSION SX(*), SY(*)
53
DATA ZERO, ONE /0.0E0, 1.0E0/
54
C***FIRST EXECUTABLE STATEMENT SROT
55
IF (N .LE. 0 .OR. (SS .EQ. ZERO .AND. SC .EQ. ONE)) GO TO 40
56
IF (.NOT. (INCX .EQ. INCY .AND. INCX .GT. 0)) GO TO 20
58
C Code for equal and positive increments.
61
DO 10 I = 1,NSTEPS,INCX
69
C Code for unequal or nonpositive increments.
75
IF (INCX .LT. 0) KX = 1-(N-1)*INCX
76
IF (INCY .LT. 0) KY = 1-(N-1)*INCY