LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
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*> \ingroup complex16_eig
147*
148* =====================================================================
149 SUBROUTINE zlsets( M, P, N, A, AF, LDA, B, BF, LDB, C, CF, D, DF,
150 $ X, WORK, LWORK, RWORK, RESULT )
151*
152* -- LAPACK test routine --
153* -- LAPACK is a software package provided by Univ. of Tennessee, --
154* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
155*
156* .. Scalar Arguments ..
157 INTEGER LDA, LDB, LWORK, M, N, P
158* ..
159* .. Array Arguments ..
160*
161* ====================================================================
162*
163 DOUBLE PRECISION RESULT( 2 ), RWORK( * )
164 COMPLEX*16 A( LDA, * ), AF( LDA, * ), B( LDB, * ),
165 $ bf( ldb, * ), c( * ), cf( * ), d( * ), df( * ),
166 $ work( lwork ), x( * )
167* ..
168* .. Local Scalars ..
169 INTEGER INFO
170* ..
171* .. External Subroutines ..
172 EXTERNAL zcopy, zget02, zgglse, zlacpy
173* ..
174* .. Executable Statements ..
175*
176* Copy the matrices A and B to the arrays AF and BF,
177* and the vectors C and D to the arrays CF and DF,
178*
179 CALL zlacpy( 'Full', m, n, a, lda, af, lda )
180 CALL zlacpy( 'Full', p, n, b, ldb, bf, ldb )
181 CALL zcopy( m, c, 1, cf, 1 )
182 CALL zcopy( p, d, 1, df, 1 )
183*
184* Solve LSE problem
185*
186 CALL zgglse( m, n, p, af, lda, bf, ldb, cf, df, x, work, lwork,
187 $ info )
188*
189* Test the residual for the solution of LSE
190*
191* Compute RESULT(1) = norm( A*x - c ) / norm(A)*norm(X)*EPS
192*
193 CALL zcopy( m, c, 1, cf, 1 )
194 CALL zcopy( p, d, 1, df, 1 )
195 CALL zget02( 'No transpose', m, n, 1, a, lda, x, n, cf, m, rwork,
196 $ result( 1 ) )
197*
198* Compute result(2) = norm( B*x - d ) / norm(B)*norm(X)*EPS
199*
200 CALL zget02( 'No transpose', p, n, 1, b, ldb, x, n, df, p, rwork,
201 $ result( 2 ) )
202*
203 RETURN
204*
205* End of ZLSETS
206*
207 END
subroutine zget02(trans, m, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
ZGET02
Definition zget02.f:134
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
Definition zcopy.f:81
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:180
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
Definition zlacpy.f:103
subroutine zlsets(m, p, n, a, af, lda, b, bf, ldb, c, cf, d, df, x, work, lwork, rwork, result)
ZLSETS
Definition zlsets.f:151