LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ slsets()

subroutine slsets ( integer  M,
integer  P,
integer  N,
real, dimension( lda, * )  A,
real, dimension( lda, * )  AF,
integer  LDA,
real, dimension( ldb, * )  B,
real, dimension( ldb, * )  BF,
integer  LDB,
real, dimension( * )  C,
real, dimension( * )  CF,
real, dimension( * )  D,
real, dimension( * )  DF,
real, dimension( * )  X,
real, dimension( lwork )  WORK,
integer  LWORK,
real, dimension( * )  RWORK,
real, dimension( 2 )  RESULT 
)

SLSETS

Purpose:
 SLSETS tests SGGLSE - a subroutine for solving linear equality
 constrained least square problem (LSE).
Parameters
[in]M
          M is INTEGER
          The number of rows of the matrix A.  M >= 0.
[in]P
          P is INTEGER
          The number of rows of the matrix B.  P >= 0.
[in]N
          N is INTEGER
          The number of columns of the matrices A and B.  N >= 0.
[in]A
          A is REAL array, dimension (LDA,N)
          The M-by-N matrix A.
[out]AF
          AF is REAL array, dimension (LDA,N)
[in]LDA
          LDA is INTEGER
          The leading dimension of the arrays A, AF, Q and R.
          LDA >= max(M,N).
[in]B
          B is REAL array, dimension (LDB,N)
          The P-by-N matrix A.
[out]BF
          BF is REAL array, dimension (LDB,N)
[in]LDB
          LDB is INTEGER
          The leading dimension of the arrays B, BF, V and S.
          LDB >= max(P,N).
[in]C
          C is REAL array, dimension( M )
          the vector C in the LSE problem.
[out]CF
          CF is REAL array, dimension( M )
[in]D
          D is REAL array, dimension( P )
          the vector D in the LSE problem.
[out]DF
          DF is REAL array, dimension( P )
[out]X
          X is REAL array, dimension( N )
          solution vector X in the LSE problem.
[out]WORK
          WORK is REAL array, dimension (LWORK)
[in]LWORK
          LWORK is INTEGER
          The dimension of the array WORK.
[out]RWORK
          RWORK is REAL array, dimension (M)
[out]RESULT
          RESULT is REAL array, dimension (2)
          The test ratios:
            RESULT(1) = norm( A*x - c )/ norm(A)*norm(X)*EPS
            RESULT(2) = norm( B*x - d )/ norm(B)*norm(X)*EPS
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 157 of file slsets.f.

157 *
158 * -- LAPACK test routine (version 3.7.0) --
159 * -- LAPACK is a software package provided by Univ. of Tennessee, --
160 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
161 * December 2016
162 *
163 * .. Scalar Arguments ..
164  INTEGER lda, ldb, lwork, m, p, n
165 * ..
166 * .. Array Arguments ..
167  REAL a( lda, * ), af( lda, * ), b( ldb, * ),
168  $ bf( ldb, * ), result( 2 ), rwork( * ),
169  $ c( * ), d( * ), cf( * ), df( * ),
170  $ work( lwork ), x( * )
171 *
172 * ====================================================================
173 *
174 * ..
175 * .. Local Scalars ..
176  INTEGER info
177 * ..
178 * .. External Subroutines ..
179  EXTERNAL sgglse, slacpy, sget02
180 * ..
181 * .. Executable Statements ..
182 *
183 * Copy the matrices A and B to the arrays AF and BF,
184 * and the vectors C and D to the arrays CF and DF,
185 *
186  CALL slacpy( 'Full', m, n, a, lda, af, lda )
187  CALL slacpy( 'Full', p, n, b, ldb, bf, ldb )
188  CALL scopy( m, c, 1, cf, 1 )
189  CALL scopy( p, d, 1, df, 1 )
190 *
191 * Solve LSE problem
192 *
193  CALL sgglse( m, n, p, af, lda, bf, ldb, cf, df, x,
194  $ work, lwork, info )
195 *
196 * Test the residual for the solution of LSE
197 *
198 * Compute RESULT(1) = norm( A*x - c ) / norm(A)*norm(X)*EPS
199 *
200  CALL scopy( m, c, 1, cf, 1 )
201  CALL scopy( p, d, 1, df, 1 )
202  CALL sget02( 'No transpose', m, n, 1, a, lda, x, n, cf, m,
203  $ rwork, result( 1 ) )
204 *
205 * Compute result(2) = norm( B*x - d ) / norm(B)*norm(X)*EPS
206 *
207  CALL sget02( 'No transpose', p, n, 1, b, ldb, x, n, df, p,
208  $ rwork, result( 2 ) )
209 *
210  RETURN
211 *
212 * End of SLSETS
213 *
subroutine sget02(TRANS, M, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
SGET02
Definition: sget02.f:135
subroutine sgglse(M, N, P, A, LDA, B, LDB, C, D, X, WORK, LWORK, INFO)
SGGLSE solves overdetermined or underdetermined systems for OTHER matrices
Definition: sgglse.f:182
subroutine slacpy(UPLO, M, N, A, LDA, B, LDB)
SLACPY copies all or part of one two-dimensional array to another.
Definition: slacpy.f:105
subroutine scopy(N, SX, INCX, SY, INCY)
SCOPY
Definition: scopy.f:84
Here is the call graph for this function:
Here is the caller graph for this function: