Example program for zgglse
This example solves the least squares problem
minimize
x
c
-
A
x
2
subject to
B
x
=
d
where
c
=
-
2.54
+
0.09
i
1.65
-
2.26
i
-
2.11
-
3.96
i
1.82
+
3.30
i
-
6.41
+
3.77
i
2.07
+
0.66
i
,
and
A
=
0.96
-
0.81
i
-
0.03
+
0.96
i
-
0.91
+
2.06
i
-
0.05
+
0.41
i
-
0.98
+
1.98
i
-
1.20
+
0.19
i
-
0.66
+
0.42
i
-
0.81
+
0.56
i
0.62
-
0.46
i
1.01
+
0.02
i
0.63
-
0.17
i
-
1.11
+
0.60
i
0.37
+
0.38
i
0.19
-
0.54
i
-
0.98
-
0.36
i
0.22
-
0.20
i
0.83
+
0.51
i
0.20
+
0.01
i
-
0.17
-
0.46
i
1.47
+
1.59
i
1.08
-
0.28
i
0.20
-
0.12
i
-
0.07
+
1.23
i
0.26
+
0.26
i
,
B
=
1.0
+
0.0
i
0
.0
i
+
0.0
-
1.0
+
0.0
i
0
.0
i
+
0.0
0
.0
i
+
0.0
1.0
+
0.0
i
0
.0
i
+
0.0
-
1.0
+
0.0
i
and
d
=
0
0
.
The constraints
B
x
=
d
correspond to
x
1
=
x
3
and
x
2
=
x
4
.
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