This package contains the Fortran 77 and Fortran 90 codes accompanying the SIAM Publications printing of "Solving Least Squares Problems" by C. Lawson and R. Hanson [1]. The original routines (most dating back to 1974) available from netlib are:
bndacc
andbndsol
implement the band-limited sequential algorithmhfti
solves a least squares problem by Householder transformationsldp
solves the least distance programming problemnnls
solves a least squares problem, subject to all variables being nonnegativeqrbd
computes the singular value decomposition of a bidiagonal matrixbvls
solves a least squares problem, subject to all variables having upper and lower boundssva
implements singular value analysis and Levenberg-Marquardt analysissvdrs
computes the singular value decomposition
Some additional utility routines for performing Householder transformations (h12
), orthogonal rotations (g1
and g2
), and generating random integer sequences (gen
) are also available. More details concerning the routines can be found in the original work [1].
Due to the limitations of early Fortran dialects, the original routines are unwieldy to use, requiring the user to provide several dimensioning variables and manually allocate scratch space. Nevertheless, the usefulness of these routines has prompted users to rewrite them in C, C++, Python and recently Julia; or, develop wrappers for languages like R, Ruby (through f2c) and Python (SciPy). Ironically, only Fortran developers are stuck with the old legacy interface.
To improve the state of things, this package aims to provide updated versions of the original codes. In the meanwhile, we have prepared some simplified interfaces:
call nnls(A,b,x[,rnorm,ierr])
call bvls(A,b,bnd,x[,rnorm,ierr])
call ldp(G,h,x[,xnorm,ierr])
call hfti(A,b,x,tau[,krank,rnorm])
[1] Lawson, Charles L., and Richard J. Hanson. Solving least squares problems. Vol. 15. Siam, 1995.