DGELSD Example

To solve the linear least squares problem

$\displaystyle \min_{{x}}^{}$$\displaystyle \left\Vert\vphantom{ b - A x }\right.$b - Ax$\displaystyle \left.\vphantom{ b - A x }\right\Vert _{{2}}^{}$

for the solution, x, of minimum norm, where

A = $\displaystyle \left(\vphantom{
\begin{array}{rrrrrr}
-0.09 & -1.56 & -1.48 & ...
...14 & 1.24 \\
1.29 & 0.51 & -0.96 & -1.27 & 1.74 & 0.34
\end{array} }\right.$$\displaystyle \begin{array}{rrrrrr}
-0.09 & -1.56 & -1.48 & -1.09 & 0.08 & -1....
...2.11 & 0.14 & 1.24 \\
1.29 & 0.51 & -0.96 & -1.27 & 1.74 & 0.34
\end{array}$$\displaystyle \left.\vphantom{
\begin{array}{rrrrrr}
-0.09 & -1.56 & -1.48 & ...
...14 & 1.24 \\
1.29 & 0.51 & -0.96 & -1.27 & 1.74 & 0.34
\end{array} }\right)$  and  b = $\displaystyle \left(\vphantom{
\begin{array}{r}
7.4 \\
4.3 \\
-8.1 \\
1.8 \\
8.7
\end{array} }\right.$$\displaystyle \begin{array}{r}
7.4 \\
4.3 \\
-8.1 \\
1.8 \\
8.7
\end{array}$$\displaystyle \left.\vphantom{
\begin{array}{r}
7.4 \\
4.3 \\
-8.1 \\
1.8 \\
8.7
\end{array} }\right)$.

A tolerance of 0.01 is used to determine the effective rank of A.

Example program
Example data
Example results