LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dlsets()

subroutine dlsets ( integer  m,
integer  p,
integer  n,
double precision, dimension( lda, * )  a,
double precision, dimension( lda, * )  af,
integer  lda,
double precision, dimension( ldb, * )  b,
double precision, dimension( ldb, * )  bf,
integer  ldb,
double precision, dimension( * )  c,
double precision, dimension( * )  cf,
double precision, dimension( * )  d,
double precision, dimension( * )  df,
double precision, dimension( * )  x,
double precision, dimension( lwork )  work,
integer  lwork,
double precision, dimension( * )  rwork,
double precision, dimension( 2 )  result 
)

DLSETS

Purpose:
 DLSETS tests DGGLSE - 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 DOUBLE PRECISION array, dimension (LDA,N)
          The M-by-N matrix A.
[out]AF
          AF is DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension (LDB,N)
          The P-by-N matrix A.
[out]BF
          BF is DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension( M )
          the vector C in the LSE problem.
[out]CF
          CF is DOUBLE PRECISION array, dimension( M )
[in]D
          D is DOUBLE PRECISION array, dimension( P )
          the vector D in the LSE problem.
[out]DF
          DF is DOUBLE PRECISION array, dimension( P )
[out]X
          X is DOUBLE PRECISION array, dimension( N )
          solution vector X in the LSE problem.
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (LWORK)
[in]LWORK
          LWORK is INTEGER
          The dimension of the array WORK.
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (M)
[out]RESULT
          RESULT is DOUBLE PRECISION 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.

Definition at line 149 of file dlsets.f.

151*
152* -- LAPACK test routine --
153* -- LAPACK is a software package provided by Univ. of Tennessee, --
154* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
155*
156* .. Scalar Arguments ..
157 INTEGER LDA, LDB, LWORK, M, N, P
158* ..
159* .. Array Arguments ..
160*
161* ====================================================================
162*
163 DOUBLE PRECISION A( LDA, * ), AF( LDA, * ), B( LDB, * ),
164 $ BF( LDB, * ), C( * ), CF( * ), D( * ), DF( * ),
165 $ RESULT( 2 ), RWORK( * ), WORK( LWORK ), X( * )
166* ..
167* .. Local Scalars ..
168 INTEGER INFO
169* ..
170* .. External Subroutines ..
171 EXTERNAL dcopy, dget02, dgglse, dlacpy
172* ..
173* .. Executable Statements ..
174*
175* Copy the matrices A and B to the arrays AF and BF,
176* and the vectors C and D to the arrays CF and DF,
177*
178 CALL dlacpy( 'Full', m, n, a, lda, af, lda )
179 CALL dlacpy( 'Full', p, n, b, ldb, bf, ldb )
180 CALL dcopy( m, c, 1, cf, 1 )
181 CALL dcopy( p, d, 1, df, 1 )
182*
183* Solve LSE problem
184*
185 CALL dgglse( m, n, p, af, lda, bf, ldb, cf, df, x, work, lwork,
186 $ info )
187*
188* Test the residual for the solution of LSE
189*
190* Compute RESULT(1) = norm( A*x - c ) / norm(A)*norm(X)*EPS
191*
192 CALL dcopy( m, c, 1, cf, 1 )
193 CALL dcopy( p, d, 1, df, 1 )
194 CALL dget02( 'No transpose', m, n, 1, a, lda, x, n, cf, m, rwork,
195 $ result( 1 ) )
196*
197* Compute result(2) = norm( B*x - d ) / norm(B)*norm(X)*EPS
198*
199 CALL dget02( 'No transpose', p, n, 1, b, ldb, x, n, df, p, rwork,
200 $ result( 2 ) )
201*
202 RETURN
203*
204* End of DLSETS
205*
subroutine dget02(trans, m, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
DGET02
Definition dget02.f:135
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
Definition dcopy.f:82
subroutine dgglse(m, n, p, a, lda, b, ldb, c, d, x, work, lwork, info)
DGGLSE solves overdetermined or underdetermined systems for OTHER matrices
Definition dgglse.f:180
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
Definition dlacpy.f:103
Here is the call graph for this function:
Here is the caller graph for this function: