LSSODS(3)

SYNOPSIS
SUBROUTINE LSSODS (A, X, B, M, N, NRDA, IFLAG, IRANK, ISCALE, Q, + DIAG, KPIVOT, ITER, RESNRM, XNORM, Z, R, DIV, TD, SCALES)

NAME
lssods - Subsidiary to BVSUP

LIBRARY
SLATEC

TYPE
SINGLE PRECISION (LSSODS-S)

AUTHOR
(UNKNOWN)

DESCRIPTION
LSSODS solves the same problem as SODS (in fact, it is called by SODS) but is somewhat more flexible in its use. In particular, LSSODS allows for iterative refinement of the solution, makes the transformation and triangular reduction information more accessible, and enables the user to avoid destruction of the original matrix A. Modeled after the ALGOL codes in the articles in the REFERENCES section. ********************************************************************** INPUT ********************************************************************** A -- Contains the matrix of M equations in N unknowns and must be dimensioned NRDA by N. A remains unchanged X -- Solution array of length at least N B -- Given constant vector of length M, B remains unchanged M -- Number of equations, M greater or equal to 1 N -- Number of unknowns, N not larger than M NRDA -- Row dimension of A, NRDA greater or equal to M IFLAG -- Status indicator = 0 for the first call (and for each new problem defined by a new matrix A) when the matrix data is treated as exact =-K for the first call (and for each new problem defined by a new matrix A) when the matrix data is assumed to be accurate to about K digits = 1 for subsequent calls whenever the matrix A has already been decomposed (problems with new vectors B but same matrix a can be handled efficiently) ISCALE -- Scaling indicator =-1 if the matrix A is to be pre-scaled by columns when appropriate If the scaling indicator is not equal to -1 no scaling will be attempted For most problems scaling will probably not be necessary ITER -- Maximum number of iterative improvement steps to be performed, 0 .LE. ITER .LE. 10 (SODS uses ITER=0) Q -- Matrix used for the transformation, must be dimensioned NRDA by N (SODS puts A in the Q location which conserves storage but destroys A) When iterative improvement of the solution is requested, ITER .GT. 0, this additional storage for Q must be made available DIAG,KPIVOT,Z,R, -- Arrays of length N (except for R which is M) DIV,TD,SCALES used for internal storage ********************************************************************** OUTPUT ********************************************************************** IFLAG -- Status indicator =1 if solution was obtained =2 if improper input is detected =3 if rank of matrix is less than N if the minimal length least squares solution is desired, simply reset IFLAG=1 and call the code again The next three IFLAG values can occur only when the iterative improvement mode is being used. =4 if the problem is ill-conditioned and maximal machine accuracy is not achievable =5 if the problem is very ill-conditioned and the solution IS likely to have no correct digits =6 if the allowable number of iterative improvement steps has been completed without getting convergence X -- Least squares solution of A X = B IRANK -- Contains the numerically determined matrix rank the user must not alter this value on succeeding calls with input values of IFLAG=1 Q -- Contains the strictly upper triangular part of the reduced matrix and the transformation information in the lower triangular part DIAG -- Contains the diagonal elements of the triangular reduced matrix KPIVOT -- Contains the pivotal information. The column interchanges performed on the original matrix are recorded here ITER -- The actual number of iterative corrections used RESNRM -- The Euclidean norm of the residual vector B - A X XNORM -- The Euclidean norm of the solution vector DIV,TD -- Contains transformation information for rank deficient problems SCALES -- Contains the column scaling parameters **********************************************************************

SEE ALSO
BVSUP

REFERENCES
G. Golub, Numerical methods for solving linear least squares problems, Numerische Mathematik 7, (1965), pp. 206-216. P. Businger and G. Golub, Linear least squares solutions by Householder transformations, Numerische Mathematik 7, (1965), pp. 269-276.

ROUTINES CALLED
J4SAVE, OHTROR, ORTHOL, R1MACH, SDOT, SDSDOT, XERMAX, XERMSG, XGETF, XSETF

REVISION HISTORY (YYMMDD)
750601 DATE WRITTEN
890531 Changed all specific intrinsics to generic. (WRB)
890831 Modified array declarations. (WRB)
891214 Prologue converted to Version 4.0 format. (BAB)
900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
900402 Added TYPE section. (WRB)
910408 Updated the REFERENCES section. (WRB)
920501 Reformatted the REFERENCES section. (WRB)