LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ dglmts()

 subroutine dglmts ( integer N, integer M, integer P, 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( * ) D, double precision, dimension( * ) DF, double precision, dimension( * ) X, double precision, dimension( * ) U, double precision, dimension( lwork ) WORK, integer LWORK, double precision, dimension( * ) RWORK, double precision RESULT )

DGLMTS

Purpose:
``` DGLMTS tests DGGGLM - a subroutine for solving the generalized
linear model problem.```
Parameters
 [in] N ``` N is INTEGER The number of rows of the matrices A and B. N >= 0.``` [in] M ``` M is INTEGER The number of columns of the matrix A. M >= 0.``` [in] P ``` P is INTEGER The number of columns of the matrix B. P >= 0.``` [in] A ``` A is DOUBLE PRECISION array, dimension (LDA,M) The N-by-M matrix A.``` [out] AF ` AF is DOUBLE PRECISION array, dimension (LDA,M)` [in] LDA ``` LDA is INTEGER The leading dimension of the arrays A, AF. LDA >= max(M,N).``` [in] B ``` B is DOUBLE PRECISION array, dimension (LDB,P) The N-by-P matrix A.``` [out] BF ` BF is DOUBLE PRECISION array, dimension (LDB,P)` [in] LDB ``` LDB is INTEGER The leading dimension of the arrays B, BF. LDB >= max(P,N).``` [in] D ``` D is DOUBLE PRECISION array, dimension( N ) On input, the left hand side of the GLM.``` [out] DF ` DF is DOUBLE PRECISION array, dimension( N )` [out] X ``` X is DOUBLE PRECISION array, dimension( M ) solution vector X in the GLM problem.``` [out] U ``` U is DOUBLE PRECISION array, dimension( P ) solution vector U in the GLM 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 The test ratio: norm( d - A*x - B*u ) RESULT = ----------------------------------------- (norm(A)+norm(B))*(norm(x)+norm(u))*EPS```
Date
December 2016

Definition at line 148 of file dglmts.f.

148 *
149 * -- LAPACK test routine (version 3.7.0) --
150 * -- LAPACK is a software package provided by Univ. of Tennessee, --
151 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
152 * December 2016
153 *
154 * .. Scalar Arguments ..
155  INTEGER lda, ldb, lwork, m, n, p
156  DOUBLE PRECISION result
157 * ..
158 * .. Array Arguments ..
159 *
160 * ====================================================================
161 *
162  DOUBLE PRECISION a( lda, * ), af( lda, * ), b( ldb, * ),
163  \$ bf( ldb, * ), d( * ), df( * ), rwork( * ),
164  \$ u( * ), work( lwork ), x( * )
165 * ..
166 * .. Parameters ..
167  DOUBLE PRECISION zero, one
168  parameter( zero = 0.0d+0, one = 1.0d+0 )
169 * ..
170 * .. Local Scalars ..
171  INTEGER info
172  DOUBLE PRECISION anorm, bnorm, dnorm, eps, unfl, xnorm, ynorm
173 * ..
174 * .. External Functions ..
175  DOUBLE PRECISION dasum, dlamch, dlange
176  EXTERNAL dasum, dlamch, dlange
177 * ..
178 * .. External Subroutines ..
179 *
180  EXTERNAL dcopy, dgemv, dggglm, dlacpy
181 * ..
182 * .. Intrinsic Functions ..
183  INTRINSIC max
184 * ..
185 * .. Executable Statements ..
186 *
187  eps = dlamch( 'Epsilon' )
188  unfl = dlamch( 'Safe minimum' )
189  anorm = max( dlange( '1', n, m, a, lda, rwork ), unfl )
190  bnorm = max( dlange( '1', n, p, b, ldb, rwork ), unfl )
191 *
192 * Copy the matrices A and B to the arrays AF and BF,
193 * and the vector D the array DF.
194 *
195  CALL dlacpy( 'Full', n, m, a, lda, af, lda )
196  CALL dlacpy( 'Full', n, p, b, ldb, bf, ldb )
197  CALL dcopy( n, d, 1, df, 1 )
198 *
199 * Solve GLM problem
200 *
201  CALL dggglm( n, m, p, af, lda, bf, ldb, df, x, u, work, lwork,
202  \$ info )
203 *
204 * Test the residual for the solution of LSE
205 *
206 * norm( d - A*x - B*u )
207 * RESULT = -----------------------------------------
208 * (norm(A)+norm(B))*(norm(x)+norm(u))*EPS
209 *
210  CALL dcopy( n, d, 1, df, 1 )
211  CALL dgemv( 'No transpose', n, m, -one, a, lda, x, 1, one, df, 1 )
212 *
213  CALL dgemv( 'No transpose', n, p, -one, b, ldb, u, 1, one, df, 1 )
214 *
215  dnorm = dasum( n, df, 1 )
216  xnorm = dasum( m, x, 1 ) + dasum( p, u, 1 )
217  ynorm = anorm + bnorm
218 *
219  IF( xnorm.LE.zero ) THEN
220  result = zero
221  ELSE
222  result = ( ( dnorm / ynorm ) / xnorm ) / eps
223  END IF
224 *
225  RETURN
226 *
227 * End of DGLMTS
228 *
subroutine dlacpy(UPLO, M, N, A, LDA, B, LDB)
DLACPY copies all or part of one two-dimensional array to another.
Definition: dlacpy.f:105
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine dcopy(N, DX, INCX, DY, INCY)
DCOPY
Definition: dcopy.f:84
subroutine dgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
DGEMV
Definition: dgemv.f:158
double precision function dlange(NORM, M, N, A, LDA, WORK)
DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: dlange.f:116
double precision function dasum(N, DX, INCX)
DASUM
Definition: dasum.f:73
subroutine dggglm(N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK, INFO)
DGGGLM
Definition: dggglm.f:187
Here is the call graph for this function:
Here is the caller graph for this function: