SLATEC Routines --- DORTHR ---


*DECK DORTHR
      SUBROUTINE DORTHR (A, N, M, NRDA, IFLAG, IRANK, ISCALE, DIAG,
     +   KPIVOT, SCALES, ROWS, RS)
C***BEGIN PROLOGUE  DORTHR
C***SUBSIDIARY
C***PURPOSE  Subsidiary to DBVSUP and DSUDS
C***LIBRARY   SLATEC
C***TYPE      DOUBLE PRECISION (ORTHOR-S, DORTHR-D)
C***AUTHOR  Watts, H. A., (SNLA)
C***DESCRIPTION
C
C   Reduction of the matrix A to lower triangular form by a sequence of
C   orthogonal HOUSEHOLDER transformations post-multiplying A.
C
C *********************************************************************
C   INPUT
C *********************************************************************
C
C     A -- Contains the matrix to be decomposed, must be dimensioned
C           NRDA by N.
C     N -- Number of rows in the matrix, N greater or equal to 1.
C     M -- Number of columns in the matrix, M greater or equal to N.
C     IFLAG -- Indicates the uncertainty in the matrix data.
C             = 0 when the data is to be treated as exact.
C             =-K when the data is assumed to be accurate to about
C                 K digits.
C     ISCALE -- Scaling indicator.
C               =-1 if the matrix is to be pre-scaled by
C               columns when appropriate.
C               Otherwise no scaling will be attempted.
C     NRDA -- Row dimension of A, NRDA greater or equal to N.
C     DIAG,KPIVOT,ROWS, -- Arrays of length at least N used internally
C          RS,SCALES         (except for SCALES which is M).
C
C *********************************************************************
C   OUTPUT
C *********************************************************************
C
C     IFLAG - Status indicator
C            =1 for successful decomposition.
C            =2 if improper input is detected.
C            =3 if rank of the matrix is less than N.
C     A -- Contains the reduced matrix in the strictly lower triangular
C          part and transformation information.
C     IRANK -- Contains the numerically determined matrix rank.
C     DIAG -- Contains the diagonal elements of the reduced
C             triangular matrix.
C     KPIVOT -- Contains the pivotal information, the column
C               interchanges performed on the original matrix are
C               recorded here.
C     SCALES -- Contains the column scaling parameters.
C
C *********************************************************************
C
C***SEE ALSO  DBVSUP, DSUDS
C***REFERENCES  G. Golub, Numerical methods for solving linear least
C                 squares problems, Numerische Mathematik 7, (1965),
C                 pp. 206-216.
C               P. Businger and G. Golub, Linear least squares
C                 solutions by Householder transformations, Numerische
C                 Mathematik  7, (1965), pp. 269-276.
C***ROUTINES CALLED  D1MACH, DCSCAL, DDOT, XERMSG
C***REVISION HISTORY  (YYMMDD)
C   750601  DATE WRITTEN
C   890531  Changed all specific intrinsics to generic.  (WRB)
C   891214  Prologue converted to Version 4.0 format.  (BAB)
C   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
C   900328  Added TYPE section.  (WRB)
C   910408  Updated the AUTHOR and REFERENCES sections.  (WRB)
C   920501  Reformatted the REFERENCES section.  (WRB)
C***END PROLOGUE  DORTHR