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