Example program for dggrqf
This example solves the least squares problem
minimize
x
c
-
A
x
2
subject to
B
x
=
d
where
A
=
-
0.57
-
1.28
-
0.39
0.25
-
1.93
1.08
-
0.31
-
2.14
2.30
0.24
0.40
-
0.35
-
1.93
0.64
-
0.66
0.08
0.15
0.30
0.15
-
2.13
-
0.02
1.03
-
1.43
0.50
,
B
=
1
0
-
1
0
0
1
0
-
1
,
c
=
-
1.50
-
2.14
1.23
-
0.54
-
1.68
0.82
and
d
=
0
0
.
The constraints
B
x
=
d
correspond to
x
1
=
x
3
and
x
2
=
x
4
.
The solution is obtained by first computing a generalized
R
Q
factorization of the matrix pair
B
,
A
. The example illustrates the general solution process.
Note that the block size (NB) of
64
assumed in this example is not realistic for such a small problem, but should be suitable for large problems.
f90 source code
Input data file
Expected results