![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b ZLSETS 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 * Definition: 00009 * =========== 00010 * 00011 * SUBROUTINE ZLSETS( M, P, N, A, AF, LDA, B, BF, LDB, C, CF, D, DF, 00012 * X, WORK, LWORK, RWORK, RESULT ) 00013 * 00014 * .. Scalar Arguments .. 00015 * INTEGER LDA, LDB, LWORK, M, N, P 00016 * .. 00017 * .. Array Arguments .. 00018 * 00019 * 00020 *> \par Purpose: 00021 * ============= 00022 *> 00023 *> \verbatim 00024 *> 00025 *> ZLSETS tests ZGGLSE - a subroutine for solving linear equality 00026 *> constrained least square problem (LSE). 00027 *> \endverbatim 00028 * 00029 * Arguments: 00030 * ========== 00031 * 00032 *> \param[in] M 00033 *> \verbatim 00034 *> M is INTEGER 00035 *> The number of rows of the matrix A. M >= 0. 00036 *> \endverbatim 00037 *> 00038 *> \param[in] P 00039 *> \verbatim 00040 *> P is INTEGER 00041 *> The number of rows of the matrix B. P >= 0. 00042 *> \endverbatim 00043 *> 00044 *> \param[in] N 00045 *> \verbatim 00046 *> N is INTEGER 00047 *> The number of columns of the matrices A and B. N >= 0. 00048 *> \endverbatim 00049 *> 00050 *> \param[in] A 00051 *> \verbatim 00052 *> A is COMPLEX*16 array, dimension (LDA,N) 00053 *> The M-by-N matrix A. 00054 *> \endverbatim 00055 *> 00056 *> \param[out] AF 00057 *> \verbatim 00058 *> AF is COMPLEX*16 array, dimension (LDA,N) 00059 *> \endverbatim 00060 *> 00061 *> \param[in] LDA 00062 *> \verbatim 00063 *> LDA is INTEGER 00064 *> The leading dimension of the arrays A, AF, Q and R. 00065 *> LDA >= max(M,N). 00066 *> \endverbatim 00067 *> 00068 *> \param[in] B 00069 *> \verbatim 00070 *> B is COMPLEX*16 array, dimension (LDB,N) 00071 *> The P-by-N matrix A. 00072 *> \endverbatim 00073 *> 00074 *> \param[out] BF 00075 *> \verbatim 00076 *> BF is COMPLEX*16 array, dimension (LDB,N) 00077 *> \endverbatim 00078 *> 00079 *> \param[in] LDB 00080 *> \verbatim 00081 *> LDB is INTEGER 00082 *> The leading dimension of the arrays B, BF, V and S. 00083 *> LDB >= max(P,N). 00084 *> \endverbatim 00085 *> 00086 *> \param[in] C 00087 *> \verbatim 00088 *> C is COMPLEX*16 array, dimension( M ) 00089 *> the vector C in the LSE problem. 00090 *> \endverbatim 00091 *> 00092 *> \param[out] CF 00093 *> \verbatim 00094 *> CF is COMPLEX*16 array, dimension( M ) 00095 *> \endverbatim 00096 *> 00097 *> \param[in] D 00098 *> \verbatim 00099 *> D is COMPLEX*16 array, dimension( P ) 00100 *> the vector D in the LSE problem. 00101 *> \endverbatim 00102 *> 00103 *> \param[out] DF 00104 *> \verbatim 00105 *> DF is COMPLEX*16 array, dimension( P ) 00106 *> \endverbatim 00107 *> 00108 *> \param[out] X 00109 *> \verbatim 00110 *> X is COMPLEX*16 array, dimension( N ) 00111 *> solution vector X in the LSE problem. 00112 *> \endverbatim 00113 *> 00114 *> \param[out] WORK 00115 *> \verbatim 00116 *> WORK is COMPLEX*16 array, dimension (LWORK) 00117 *> \endverbatim 00118 *> 00119 *> \param[in] LWORK 00120 *> \verbatim 00121 *> LWORK is INTEGER 00122 *> The dimension of the array WORK. 00123 *> \endverbatim 00124 *> 00125 *> \param[out] RWORK 00126 *> \verbatim 00127 *> RWORK is DOUBLE PRECISION array, dimension (M) 00128 *> \endverbatim 00129 *> 00130 *> \param[out] RESULT 00131 *> \verbatim 00132 *> RESULT is DOUBLE PRECISION array, dimension (2) 00133 *> The test ratios: 00134 *> RESULT(1) = norm( A*x - c )/ norm(A)*norm(X)*EPS 00135 *> RESULT(2) = norm( B*x - d )/ norm(B)*norm(X)*EPS 00136 *> \endverbatim 00137 * 00138 * Authors: 00139 * ======== 00140 * 00141 *> \author Univ. of Tennessee 00142 *> \author Univ. of California Berkeley 00143 *> \author Univ. of Colorado Denver 00144 *> \author NAG Ltd. 00145 * 00146 *> \date November 2011 00147 * 00148 *> \ingroup complex16_eig 00149 * 00150 * ===================================================================== 00151 SUBROUTINE ZLSETS( M, P, N, A, AF, LDA, B, BF, LDB, C, CF, D, DF, 00152 $ X, WORK, LWORK, RWORK, RESULT ) 00153 * 00154 * -- LAPACK test routine (version 3.4.0) -- 00155 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00156 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00157 * November 2011 00158 * 00159 * .. Scalar Arguments .. 00160 INTEGER LDA, LDB, LWORK, M, N, P 00161 * .. 00162 * .. Array Arguments .. 00163 * 00164 * ==================================================================== 00165 * 00166 DOUBLE PRECISION RESULT( 2 ), RWORK( * ) 00167 COMPLEX*16 A( LDA, * ), AF( LDA, * ), B( LDB, * ), 00168 $ BF( LDB, * ), C( * ), CF( * ), D( * ), DF( * ), 00169 $ WORK( LWORK ), X( * ) 00170 * .. 00171 * .. Local Scalars .. 00172 INTEGER INFO 00173 * .. 00174 * .. External Subroutines .. 00175 EXTERNAL ZCOPY, ZGET02, ZGGLSE, ZLACPY 00176 * .. 00177 * .. Executable Statements .. 00178 * 00179 * Copy the matrices A and B to the arrays AF and BF, 00180 * and the vectors C and D to the arrays CF and DF, 00181 * 00182 CALL ZLACPY( 'Full', M, N, A, LDA, AF, LDA ) 00183 CALL ZLACPY( 'Full', P, N, B, LDB, BF, LDB ) 00184 CALL ZCOPY( M, C, 1, CF, 1 ) 00185 CALL ZCOPY( P, D, 1, DF, 1 ) 00186 * 00187 * Solve LSE problem 00188 * 00189 CALL ZGGLSE( M, N, P, AF, LDA, BF, LDB, CF, DF, X, WORK, LWORK, 00190 $ INFO ) 00191 * 00192 * Test the residual for the solution of LSE 00193 * 00194 * Compute RESULT(1) = norm( A*x - c ) / norm(A)*norm(X)*EPS 00195 * 00196 CALL ZCOPY( M, C, 1, CF, 1 ) 00197 CALL ZCOPY( P, D, 1, DF, 1 ) 00198 CALL ZGET02( 'No transpose', M, N, 1, A, LDA, X, N, CF, M, RWORK, 00199 $ RESULT( 1 ) ) 00200 * 00201 * Compute result(2) = norm( B*x - d ) / norm(B)*norm(X)*EPS 00202 * 00203 CALL ZGET02( 'No transpose', P, N, 1, B, LDB, X, N, DF, P, RWORK, 00204 $ RESULT( 2 ) ) 00205 * 00206 RETURN 00207 * 00208 * End of ZLSETS 00209 * 00210 END