kusano 2b45e8
      SUBROUTINE DROTMF (N,DX,INCX,DY,INCY,DPARAM)
kusano 2b45e8
C
kusano 2b45e8
C     APPLY THE MODIFIED GIVENS TRANSFORMATION, H, TO THE 2 BY N MATRIX
kusano 2b45e8
C
kusano 2b45e8
C     (DX**T) , WHERE **T INDICATES TRANSPOSE. THE ELEMENTS OF DX ARE IN
kusano 2b45e8
C     (DY**T)
kusano 2b45e8
C
kusano 2b45e8
C     DX(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 LY AND INCY.
kusano 2b45e8
C     WITH DPARAM(1)=DFLAG, H HAS ONE OF THE FOLLOWING FORMS..
kusano 2b45e8
C
kusano 2b45e8
C     DFLAG=-1.D0     DFLAG=0.D0        DFLAG=1.D0     DFLAG=-2.D0
kusano 2b45e8
C
kusano 2b45e8
C       (DH11  DH12)    (1.D0  DH12)    (DH11  1.D0)    (1.D0  0.D0)
kusano 2b45e8
C     H=(          )    (          )    (          )    (          )
kusano 2b45e8
C       (DH21  DH22),   (DH21  1.D0),   (-1.D0 DH22),   (0.D0  1.D0).
kusano 2b45e8
C     SEE DROTMG FOR A DESCRIPTION OF DATA STORAGE IN DPARAM.
kusano 2b45e8
C
kusano 2b45e8
      DOUBLE PRECISION DFLAG,DH12,DH22,DX,TWO,Z,DH11,DH21,
kusano 2b45e8
     1 DPARAM,DY,W,ZERO
kusano 2b45e8
      DIMENSION DX(1),DY(1),DPARAM(5)
kusano 2b45e8
      DATA ZERO,TWO/0.D0,2.D0/
kusano 2b45e8
C
kusano 2b45e8
      DFLAG=DPARAM(1)
kusano 2b45e8
      IF(N .LE. 0 .OR.(DFLAG+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(DFLAG) 50,10,30
kusano 2b45e8
   10          CONTINUE
kusano 2b45e8
               DH12=DPARAM(4)
kusano 2b45e8
               DH21=DPARAM(3)
kusano 2b45e8
                    DO 20 I=1,NSTEPS,INCX
kusano 2b45e8
                    W=DX(I)
kusano 2b45e8
                    Z=DY(I)
kusano 2b45e8
                    DX(I)=W+Z*DH12
kusano 2b45e8
                    DY(I)=W*DH21+Z
kusano 2b45e8
   20               CONTINUE
kusano 2b45e8
               GO TO 140
kusano 2b45e8
   30          CONTINUE
kusano 2b45e8
               DH11=DPARAM(2)
kusano 2b45e8
               DH22=DPARAM(5)
kusano 2b45e8
                    DO 40 I=1,NSTEPS,INCX
kusano 2b45e8
                    W=DX(I)
kusano 2b45e8
                    Z=DY(I)
kusano 2b45e8
                    DX(I)=W*DH11+Z
kusano 2b45e8
                    DY(I)=-W+DH22*Z
kusano 2b45e8
   40               CONTINUE
kusano 2b45e8
               GO TO 140
kusano 2b45e8
   50          CONTINUE
kusano 2b45e8
               DH11=DPARAM(2)
kusano 2b45e8
               DH12=DPARAM(4)
kusano 2b45e8
               DH21=DPARAM(3)
kusano 2b45e8
               DH22=DPARAM(5)
kusano 2b45e8
                    DO 60 I=1,NSTEPS,INCX
kusano 2b45e8
                    W=DX(I)
kusano 2b45e8
                    Z=DY(I)
kusano 2b45e8
                    DX(I)=W*DH11+Z*DH12
kusano 2b45e8
                    DY(I)=W*DH21+Z*DH22
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(DFLAG)120,80,100
kusano 2b45e8
   80     CONTINUE
kusano 2b45e8
          DH12=DPARAM(4)
kusano 2b45e8
          DH21=DPARAM(3)
kusano 2b45e8
               DO 90 I=1,N
kusano 2b45e8
               W=DX(KX)
kusano 2b45e8
               Z=DY(KY)
kusano 2b45e8
               DX(KX)=W+Z*DH12
kusano 2b45e8
               DY(KY)=W*DH21+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
          DH11=DPARAM(2)
kusano 2b45e8
          DH22=DPARAM(5)
kusano 2b45e8
               DO 110 I=1,N
kusano 2b45e8
               W=DX(KX)
kusano 2b45e8
               Z=DY(KY)
kusano 2b45e8
               DX(KX)=W*DH11+Z
kusano 2b45e8
               DY(KY)=-W+DH22*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
          DH11=DPARAM(2)
kusano 2b45e8
          DH12=DPARAM(4)
kusano 2b45e8
          DH21=DPARAM(3)
kusano 2b45e8
          DH22=DPARAM(5)
kusano 2b45e8
               DO 130 I=1,N
kusano 2b45e8
               W=DX(KX)
kusano 2b45e8
               Z=DY(KY)
kusano 2b45e8
               DX(KX)=W*DH11+Z*DH12
kusano 2b45e8
               DY(KY)=W*DH21+Z*DH22
kusano 2b45e8
               KX=KX+INCX
kusano 2b45e8
               KY=KY+INCY
kusano 2b45e8
  130          CONTINUE
kusano 2b45e8
  140     CONTINUE
kusano 2b45e8
          RETURN
kusano 2b45e8
          END