      SUBROUTINE TR1 (A,MDIMA,U,S,I1,I2,J1,J2)
C
C        THIS ROUTINE PERFORMS THE HOUSEHOLDER TRANSFORMATION
C               H = I - S * U * U'
C        ON ROWS I1+1 TO I1+I2 OF A, THIS FROM COLUMNS J1 TO J2.
C
      DOUBLE PRECISION A(MDIMA,1),U(1),S,INPROD,Y
      DO 20 J = J1,J2
         INPROD = 0.0D0
         DO 10 I = 1,I2
   10       INPROD = INPROD+U(I)*A(I1+I,J)
         Y = INPROD*S
         DO 20 I =1,I2
   20       A(I1+I,J) = A(I1+I,J)-U(I)*Y
      RETURN
      END
