3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE DLSETS( M, P, N, A, AF, LDA, B, BF, LDB, C, CF, D, DF,
12 * X, WORK, LWORK, RWORK, RESULT )
14 * .. Scalar Arguments ..
15 * INTEGER LDA, LDB, LWORK, M, N, P
17 * .. Array Arguments ..
25 *> DLSETS tests DGGLSE - a subroutine for solving linear equality
26 *> constrained least square problem (LSE).
35 *> The number of rows of the matrix A. M >= 0.
41 *> The number of rows of the matrix B. P >= 0.
47 *> The number of columns of the matrices A and B. N >= 0.
52 *> A is DOUBLE PRECISION array, dimension (LDA,N)
53 *> The M-by-N matrix A.
58 *> AF is DOUBLE PRECISION array, dimension (LDA,N)
64 *> The leading dimension of the arrays A, AF, Q and R.
70 *> B is DOUBLE PRECISION array, dimension (LDB,N)
71 *> The P-by-N matrix A.
76 *> BF is DOUBLE PRECISION array, dimension (LDB,N)
82 *> The leading dimension of the arrays B, BF, V and S.
88 *> C is DOUBLE PRECISION array, dimension( M )
89 *> the vector C in the LSE problem.
94 *> CF is DOUBLE PRECISION array, dimension( M )
99 *> D is DOUBLE PRECISION array, dimension( P )
100 *> the vector D in the LSE problem.
105 *> DF is DOUBLE PRECISION array, dimension( P )
110 *> X is DOUBLE PRECISION array, dimension( N )
111 *> solution vector X in the LSE problem.
116 *> WORK is DOUBLE PRECISION array, dimension (LWORK)
122 *> The dimension of the array WORK.
127 *> RWORK is DOUBLE PRECISION array, dimension (M)
130 *> \param[out] RESULT
132 *> RESULT is DOUBLE PRECISION array, dimension (2)
134 *> RESULT(1) = norm( A*x - c )/ norm(A)*norm(X)*EPS
135 *> RESULT(2) = norm( B*x - d )/ norm(B)*norm(X)*EPS
141 *> \author Univ. of Tennessee
142 *> \author Univ. of California Berkeley
143 *> \author Univ. of Colorado Denver
146 *> \date November 2011
148 *> \ingroup double_eig
150 * =====================================================================
151 SUBROUTINE DLSETS( M, P, N, A, AF, LDA, B, BF, LDB, C, CF, D, DF,
152 $ X, WORK, LWORK, RWORK, RESULT )
154 * -- LAPACK test routine (version 3.4.0) --
155 * -- LAPACK is a software package provided by Univ. of Tennessee, --
156 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
159 * .. Scalar Arguments ..
160 INTEGER LDA, LDB, LWORK, M, N, P
162 * .. Array Arguments ..
164 * ====================================================================
166 DOUBLE PRECISION A( LDA, * ), AF( LDA, * ), B( LDB, * ),
167 $ BF( LDB, * ), C( * ), CF( * ), D( * ), DF( * ),
168 $ RESULT( 2 ), RWORK( * ), WORK( LWORK ), X( * )
170 * .. Local Scalars ..
173 * .. External Subroutines ..
174 EXTERNAL DCOPY, DGET02, DGGLSE, DLACPY
176 * .. Executable Statements ..
178 * Copy the matrices A and B to the arrays AF and BF,
179 * and the vectors C and D to the arrays CF and DF,
181 CALL DLACPY( 'Full', M, N, A, LDA, AF, LDA )
182 CALL DLACPY( 'Full', P, N, B, LDB, BF, LDB )
183 CALL DCOPY( M, C, 1, CF, 1 )
184 CALL DCOPY( P, D, 1, DF, 1 )
188 CALL DGGLSE( M, N, P, AF, LDA, BF, LDB, CF, DF, X, WORK, LWORK,
191 * Test the residual for the solution of LSE
193 * Compute RESULT(1) = norm( A*x - c ) / norm(A)*norm(X)*EPS
195 CALL DCOPY( M, C, 1, CF, 1 )
196 CALL DCOPY( P, D, 1, DF, 1 )
197 CALL DGET02( 'No transpose', M, N, 1, A, LDA, X, N, CF, M, RWORK,
200 * Compute result(2) = norm( B*x - d ) / norm(B)*norm(X)*EPS
202 CALL DGET02( 'No transpose', P, N, 1, B, LDB, X, N, DF, P, RWORK,