where is an matrix, is a given element vector
and is the element solution vector.
In the most usual case and
, and in this case the
solution to problem (2.1) is unique,
and the problem is also
referred to as finding a least squares solution to an
overdetermined system of linear equations.
When and
, there are an infinite number
of solutions
which exactly satisfy . In this case it is often useful to find
the unique solution which minimizes ,
and the problem
is referred to as finding a minimum norm solution to an
underdetermined system of linear equations.
The driver routine LA_GELS
solves problem (2.1) on the assumption that
-- in other words, has full rank --
finding a least squares solution of an overdetermined system
when , and a minimum norm solution of an underdetermined system
when .
LA_GELS uses a or factorization of , and also
allows to be replaced by in the statement of the problem
(or by if is complex).
In the general case when we may have
-- in other words,
may be rank-deficient --
we seek the minimum norm least squares solution
which minimizes both and
.
The driver routines
LA_GELSY,
LA_GELSS,
and LA_GELSD,
solve this general formulation of problem (2.1),
allowing for the possibility that is rank-deficient;
LA_GELSY uses a
complete orthogonal factorization of ,
while LA_GELSS uses
the singular value decomposition of ,
and LA_GELSD uses
the singular value decomposition of with an algorithm based on
divide and conquer.
The subroutine LA_GELSD is significantly faster than its older counterpart
LA_GELSS,
especially for large problems, but may require somewhat more workspace depending
on the matrix dimensions.
The LLS driver routines are listed in Table 2.3.
All four routines allow several right hand side vectors and corresponding
solutions to be handled in a single call, storing these vectors as columns
of matrices and , respectively.
Note however that problem (2.1) is solved for
each right hand side vector independently; this is not the same as
finding a matrix which minimizes
.
Table 2.3:
Driver routines for linear least squares problems