LAPACK  3.7.0 LAPACK: Linear Algebra PACKage
zlsets.f
Go to the documentation of this file.
1 *> \brief \b ZLSETS
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 * Definition:
9 * ===========
10 *
11 * SUBROUTINE ZLSETS( M, P, N, A, AF, LDA, B, BF, LDB, C, CF, D, DF,
12 * X, WORK, LWORK, RWORK, RESULT )
13 *
14 * .. Scalar Arguments ..
15 * INTEGER LDA, LDB, LWORK, M, N, P
16 * ..
17 * .. Array Arguments ..
18 *
19 *
20 *> \par Purpose:
21 * =============
22 *>
23 *> \verbatim
24 *>
25 *> ZLSETS tests ZGGLSE - a subroutine for solving linear equality
26 *> constrained least square problem (LSE).
27 *> \endverbatim
28 *
29 * Arguments:
30 * ==========
31 *
32 *> \param[in] M
33 *> \verbatim
34 *> M is INTEGER
35 *> The number of rows of the matrix A. M >= 0.
36 *> \endverbatim
37 *>
38 *> \param[in] P
39 *> \verbatim
40 *> P is INTEGER
41 *> The number of rows of the matrix B. P >= 0.
42 *> \endverbatim
43 *>
44 *> \param[in] N
45 *> \verbatim
46 *> N is INTEGER
47 *> The number of columns of the matrices A and B. N >= 0.
48 *> \endverbatim
49 *>
50 *> \param[in] A
51 *> \verbatim
52 *> A is COMPLEX*16 array, dimension (LDA,N)
53 *> The M-by-N matrix A.
54 *> \endverbatim
55 *>
56 *> \param[out] AF
57 *> \verbatim
58 *> AF is COMPLEX*16 array, dimension (LDA,N)
59 *> \endverbatim
60 *>
61 *> \param[in] LDA
62 *> \verbatim
63 *> LDA is INTEGER
64 *> The leading dimension of the arrays A, AF, Q and R.
65 *> LDA >= max(M,N).
66 *> \endverbatim
67 *>
68 *> \param[in] B
69 *> \verbatim
70 *> B is COMPLEX*16 array, dimension (LDB,N)
71 *> The P-by-N matrix A.
72 *> \endverbatim
73 *>
74 *> \param[out] BF
75 *> \verbatim
76 *> BF is COMPLEX*16 array, dimension (LDB,N)
77 *> \endverbatim
78 *>
79 *> \param[in] LDB
80 *> \verbatim
81 *> LDB is INTEGER
82 *> The leading dimension of the arrays B, BF, V and S.
83 *> LDB >= max(P,N).
84 *> \endverbatim
85 *>
86 *> \param[in] C
87 *> \verbatim
88 *> C is COMPLEX*16 array, dimension( M )
89 *> the vector C in the LSE problem.
90 *> \endverbatim
91 *>
92 *> \param[out] CF
93 *> \verbatim
94 *> CF is COMPLEX*16 array, dimension( M )
95 *> \endverbatim
96 *>
97 *> \param[in] D
98 *> \verbatim
99 *> D is COMPLEX*16 array, dimension( P )
100 *> the vector D in the LSE problem.
101 *> \endverbatim
102 *>
103 *> \param[out] DF
104 *> \verbatim
105 *> DF is COMPLEX*16 array, dimension( P )
106 *> \endverbatim
107 *>
108 *> \param[out] X
109 *> \verbatim
110 *> X is COMPLEX*16 array, dimension( N )
111 *> solution vector X in the LSE problem.
112 *> \endverbatim
113 *>
114 *> \param[out] WORK
115 *> \verbatim
116 *> WORK is COMPLEX*16 array, dimension (LWORK)
117 *> \endverbatim
118 *>
119 *> \param[in] LWORK
120 *> \verbatim
121 *> LWORK is INTEGER
122 *> The dimension of the array WORK.
123 *> \endverbatim
124 *>
125 *> \param[out] RWORK
126 *> \verbatim
127 *> RWORK is DOUBLE PRECISION array, dimension (M)
128 *> \endverbatim
129 *>
130 *> \param[out] RESULT
131 *> \verbatim
132 *> RESULT is DOUBLE PRECISION array, dimension (2)
133 *> The test ratios:
134 *> RESULT(1) = norm( A*x - c )/ norm(A)*norm(X)*EPS
135 *> RESULT(2) = norm( B*x - d )/ norm(B)*norm(X)*EPS
136 *> \endverbatim
137 *
138 * Authors:
139 * ========
140 *
141 *> \author Univ. of Tennessee
142 *> \author Univ. of California Berkeley
143 *> \author Univ. of Colorado Denver
144 *> \author NAG Ltd.
145 *
146 *> \date December 2016
147 *
148 *> \ingroup complex16_eig
149 *
150 * =====================================================================
151  SUBROUTINE zlsets( M, P, N, A, AF, LDA, B, BF, LDB, C, CF, D, DF,
152  \$ x, work, lwork, rwork, result )
153 *
154 * -- LAPACK test routine (version 3.7.0) --
155 * -- LAPACK is a software package provided by Univ. of Tennessee, --
156 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
157 * December 2016
158 *
159 * .. Scalar Arguments ..
160  INTEGER LDA, LDB, LWORK, M, N, P
161 * ..
162 * .. Array Arguments ..
163 *
164 * ====================================================================
165 *
166  DOUBLE PRECISION RESULT( 2 ), RWORK( * )
167  COMPLEX*16 A( lda, * ), AF( lda, * ), B( ldb, * ),
168  \$ bf( ldb, * ), c( * ), cf( * ), d( * ), df( * ),
169  \$ work( lwork ), x( * )
170 * ..
171 * .. Local Scalars ..
172  INTEGER INFO
173 * ..
174 * .. External Subroutines ..
175  EXTERNAL zcopy, zget02, zgglse, zlacpy
176 * ..
177 * .. Executable Statements ..
178 *
179 * Copy the matrices A and B to the arrays AF and BF,
180 * and the vectors C and D to the arrays CF and DF,
181 *
182  CALL zlacpy( 'Full', m, n, a, lda, af, lda )
183  CALL zlacpy( 'Full', p, n, b, ldb, bf, ldb )
184  CALL zcopy( m, c, 1, cf, 1 )
185  CALL zcopy( p, d, 1, df, 1 )
186 *
187 * Solve LSE problem
188 *
189  CALL zgglse( m, n, p, af, lda, bf, ldb, cf, df, x, work, lwork,
190  \$ info )
191 *
192 * Test the residual for the solution of LSE
193 *
194 * Compute RESULT(1) = norm( A*x - c ) / norm(A)*norm(X)*EPS
195 *
196  CALL zcopy( m, c, 1, cf, 1 )
197  CALL zcopy( p, d, 1, df, 1 )
198  CALL zget02( 'No transpose', m, n, 1, a, lda, x, n, cf, m, rwork,
199  \$ result( 1 ) )
200 *
201 * Compute result(2) = norm( B*x - d ) / norm(B)*norm(X)*EPS
202 *
203  CALL zget02( 'No transpose', p, n, 1, b, ldb, x, n, df, p, rwork,
204  \$ result( 2 ) )
205 *
206  RETURN
207 *
208 * End of ZLSETS
209 *
210  END
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
Definition: zcopy.f:52
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
Definition: zlacpy.f:105
subroutine zlsets(M, P, N, A, AF, LDA, B, BF, LDB, C, CF, D, DF, X, WORK, LWORK, RWORK, RESULT)
ZLSETS
Definition: zlsets.f:153
subroutine zget02(TRANS, M, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
ZGET02
Definition: zget02.f:135
subroutine zgglse(M, N, P, A, LDA, B, LDB, C, D, X, WORK, LWORK, INFO)
ZGGLSE solves overdetermined or underdetermined systems for OTHER matrices
Definition: zgglse.f:182