LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
dlsets.f
Go to the documentation of this file.
00001 *> \brief \b DLSETS
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 DLSETS( 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 *> DLSETS tests DGGLSE - 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 DOUBLE PRECISION array, dimension (LDA,N)
00053 *>          The M-by-N matrix A.
00054 *> \endverbatim
00055 *>
00056 *> \param[out] AF
00057 *> \verbatim
00058 *>          AF is DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension (LDB,N)
00071 *>          The P-by-N matrix A.
00072 *> \endverbatim
00073 *>
00074 *> \param[out] BF
00075 *> \verbatim
00076 *>          BF is DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension( M )
00089 *>          the vector C in the LSE problem.
00090 *> \endverbatim
00091 *>
00092 *> \param[out] CF
00093 *> \verbatim
00094 *>          CF is DOUBLE PRECISION array, dimension( M )
00095 *> \endverbatim
00096 *>
00097 *> \param[in] D
00098 *> \verbatim
00099 *>          D is DOUBLE PRECISION array, dimension( P )
00100 *>          the vector D in the LSE problem.
00101 *> \endverbatim
00102 *>
00103 *> \param[out] DF
00104 *> \verbatim
00105 *>          DF is DOUBLE PRECISION array, dimension( P )
00106 *> \endverbatim
00107 *>
00108 *> \param[out] X
00109 *> \verbatim
00110 *>          X is DOUBLE PRECISION array, dimension( N )
00111 *>          solution vector X in the LSE problem.
00112 *> \endverbatim
00113 *>
00114 *> \param[out] WORK
00115 *> \verbatim
00116 *>          WORK is DOUBLE PRECISION 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 double_eig
00149 *
00150 *  =====================================================================
00151       SUBROUTINE DLSETS( 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   A( LDA, * ), AF( LDA, * ), B( LDB, * ),
00167      $                   BF( LDB, * ), C( * ), CF( * ), D( * ), DF( * ),
00168      $                   RESULT( 2 ), RWORK( * ), WORK( LWORK ), X( * )
00169 *     ..
00170 *     .. Local Scalars ..
00171       INTEGER            INFO
00172 *     ..
00173 *     .. External Subroutines ..
00174       EXTERNAL           DCOPY, DGET02, DGGLSE, DLACPY
00175 *     ..
00176 *     .. Executable Statements ..
00177 *
00178 *     Copy the matrices A and B to the arrays AF and BF,
00179 *     and the vectors C and D to the arrays CF and DF,
00180 *
00181       CALL DLACPY( 'Full', M, N, A, LDA, AF, LDA )
00182       CALL DLACPY( 'Full', P, N, B, LDB, BF, LDB )
00183       CALL DCOPY( M, C, 1, CF, 1 )
00184       CALL DCOPY( P, D, 1, DF, 1 )
00185 *
00186 *     Solve LSE problem
00187 *
00188       CALL DGGLSE( M, N, P, AF, LDA, BF, LDB, CF, DF, X, WORK, LWORK,
00189      $             INFO )
00190 *
00191 *     Test the residual for the solution of LSE
00192 *
00193 *     Compute RESULT(1) = norm( A*x - c ) / norm(A)*norm(X)*EPS
00194 *
00195       CALL DCOPY( M, C, 1, CF, 1 )
00196       CALL DCOPY( P, D, 1, DF, 1 )
00197       CALL DGET02( 'No transpose', M, N, 1, A, LDA, X, N, CF, M, RWORK,
00198      $             RESULT( 1 ) )
00199 *
00200 *     Compute result(2) = norm( B*x - d ) / norm(B)*norm(X)*EPS
00201 *
00202       CALL DGET02( 'No transpose', P, N, 1, B, LDB, X, N, DF, P, RWORK,
00203      $             RESULT( 2 ) )
00204 *
00205       RETURN
00206 *
00207 *     End of DLSETS
00208 *
00209       END
 All Files Functions