kusano 2b45e8
      SUBROUTINE SROTMF (N,SX,INCX,SY,INCY,SPARAM)
kusano 2b45e8
C
kusano 2b45e8
C     APPLY THE MODIFIED GIVENS TRANSFORMATION, H, TO THE 2 BY N MATRIX
kusano 2b45e8
C
kusano 2b45e8
C     (SX**T) , WHERE **T INDICATES TRANSPOSE. THE ELEMENTS OF SX ARE IN
kusano 2b45e8
C     (DX**T)
kusano 2b45e8
C
kusano 2b45e8
C     SX(LX+I*INCX), I = 0 TO N-1, WHERE LX = 1 IF INCX .GE. 0, ELSE
kusano 2b45e8
C     LX = (-INCX)*N, AND SIMILARLY FOR SY USING USING LY AND INCY.
kusano 2b45e8
C     WITH SPARAM(1)=SFLAG, H HAS ONE OF THE FOLLOWING FORMS..
kusano 2b45e8
C
kusano 2b45e8
C     SFLAG=-1.E0     SFLAG=0.E0        SFLAG=1.E0     SFLAG=-2.E0
kusano 2b45e8
C
kusano 2b45e8
C       (SH11  SH12)    (1.E0  SH12)    (SH11  1.E0)    (1.E0  0.E0)
kusano 2b45e8
C     H=(          )    (          )    (          )    (          )
kusano 2b45e8
C       (SH21  SH22),   (SH21  1.E0),   (-1.E0 SH22),   (0.E0  1.E0).
kusano 2b45e8
C     SEE  SROTMG FOR A DESCRIPTION OF DATA STORAGE IN SPARAM.
kusano 2b45e8
C
kusano 2b45e8
      DIMENSION SX(1),SY(1),SPARAM(5)
kusano 2b45e8
      DATA ZERO,TWO/0.E0,2.E0/
kusano 2b45e8
C
kusano 2b45e8
      SFLAG=SPARAM(1)
kusano 2b45e8
      IF(N .LE. 0 .OR.(SFLAG+TWO.EQ.ZERO)) GO TO 140
kusano 2b45e8
          IF(.NOT.(INCX.EQ.INCY.AND. INCX .GT.0)) GO TO 70
kusano 2b45e8
C
kusano 2b45e8
               NSTEPS=N*INCX
kusano 2b45e8
               IF(SFLAG) 50,10,30
kusano 2b45e8
   10          CONTINUE
kusano 2b45e8
               SH12=SPARAM(4)
kusano 2b45e8
               SH21=SPARAM(3)
kusano 2b45e8
                    DO 20 I=1,NSTEPS,INCX
kusano 2b45e8
                    W=SX(I)
kusano 2b45e8
                    Z=SY(I)
kusano 2b45e8
                    SX(I)=W+Z*SH12
kusano 2b45e8
                    SY(I)=W*SH21+Z
kusano 2b45e8
   20               CONTINUE
kusano 2b45e8
               GO TO 140
kusano 2b45e8
   30          CONTINUE
kusano 2b45e8
               SH11=SPARAM(2)
kusano 2b45e8
               SH22=SPARAM(5)
kusano 2b45e8
                    DO 40 I=1,NSTEPS,INCX
kusano 2b45e8
                    W=SX(I)
kusano 2b45e8
                    Z=SY(I)
kusano 2b45e8
                    SX(I)=W*SH11+Z
kusano 2b45e8
                    SY(I)=-W+SH22*Z
kusano 2b45e8
   40               CONTINUE
kusano 2b45e8
               GO TO 140
kusano 2b45e8
   50          CONTINUE
kusano 2b45e8
               SH11=SPARAM(2)
kusano 2b45e8
               SH12=SPARAM(4)
kusano 2b45e8
               SH21=SPARAM(3)
kusano 2b45e8
               SH22=SPARAM(5)
kusano 2b45e8
                    DO 60 I=1,NSTEPS,INCX
kusano 2b45e8
                    W=SX(I)
kusano 2b45e8
                    Z=SY(I)
kusano 2b45e8
                    SX(I)=W*SH11+Z*SH12
kusano 2b45e8
                    SY(I)=W*SH21+Z*SH22
kusano 2b45e8
   60               CONTINUE
kusano 2b45e8
               GO TO 140
kusano 2b45e8
   70     CONTINUE
kusano 2b45e8
          KX=1
kusano 2b45e8
          KY=1
kusano 2b45e8
          IF(INCX .LT. 0) KX=1+(1-N)*INCX
kusano 2b45e8
          IF(INCY .LT. 0) KY=1+(1-N)*INCY
kusano 2b45e8
C
kusano 2b45e8
          IF(SFLAG)120,80,100
kusano 2b45e8
   80     CONTINUE
kusano 2b45e8
          SH12=SPARAM(4)
kusano 2b45e8
          SH21=SPARAM(3)
kusano 2b45e8
               DO 90 I=1,N
kusano 2b45e8
               W=SX(KX)
kusano 2b45e8
               Z=SY(KY)
kusano 2b45e8
               SX(KX)=W+Z*SH12
kusano 2b45e8
               SY(KY)=W*SH21+Z
kusano 2b45e8
               KX=KX+INCX
kusano 2b45e8
               KY=KY+INCY
kusano 2b45e8
   90          CONTINUE
kusano 2b45e8
          GO TO 140
kusano 2b45e8
  100     CONTINUE
kusano 2b45e8
          SH11=SPARAM(2)
kusano 2b45e8
          SH22=SPARAM(5)
kusano 2b45e8
               DO 110 I=1,N
kusano 2b45e8
               W=SX(KX)
kusano 2b45e8
               Z=SY(KY)
kusano 2b45e8
               SX(KX)=W*SH11+Z
kusano 2b45e8
               SY(KY)=-W+SH22*Z
kusano 2b45e8
               KX=KX+INCX
kusano 2b45e8
               KY=KY+INCY
kusano 2b45e8
  110          CONTINUE
kusano 2b45e8
          GO TO 140
kusano 2b45e8
  120     CONTINUE
kusano 2b45e8
          SH11=SPARAM(2)
kusano 2b45e8
          SH12=SPARAM(4)
kusano 2b45e8
          SH21=SPARAM(3)
kusano 2b45e8
          SH22=SPARAM(5)
kusano 2b45e8
               DO 130 I=1,N
kusano 2b45e8
               W=SX(KX)
kusano 2b45e8
               Z=SY(KY)
kusano 2b45e8
               SX(KX)=W*SH11+Z*SH12
kusano 2b45e8
               SY(KY)=W*SH21+Z*SH22
kusano 2b45e8
               KX=KX+INCX
kusano 2b45e8
               KY=KY+INCY
kusano 2b45e8
  130          CONTINUE
kusano 2b45e8
  140     CONTINUE
kusano 2b45e8
          RETURN
kusano 2b45e8
          END