LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zglmts()

subroutine zglmts ( integer  N,
integer  M,
integer  P,
complex*16, dimension( lda, * )  A,
complex*16, dimension( lda, * )  AF,
integer  LDA,
complex*16, dimension( ldb, * )  B,
complex*16, dimension( ldb, * )  BF,
integer  LDB,
complex*16, dimension( * )  D,
complex*16, dimension( * )  DF,
complex*16, dimension( * )  X,
complex*16, dimension( * )  U,
complex*16, dimension( lwork )  WORK,
integer  LWORK,
double precision, dimension( * )  RWORK,
double precision  RESULT 
)

ZGLMTS

Purpose:
 ZGLMTS tests ZGGGLM - 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 COMPLEX*16 array, dimension (LDA,M)
          The N-by-M matrix A.
[out]AF
          AF is COMPLEX*16 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 COMPLEX*16 array, dimension (LDB,P)
          The N-by-P matrix A.
[out]BF
          BF is COMPLEX*16 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 COMPLEX*16 array, dimension( N )
          On input, the left hand side of the GLM.
[out]DF
          DF is COMPLEX*16 array, dimension( N )
[out]X
          X is COMPLEX*16 array, dimension( M )
          solution vector X in the GLM problem.
[out]U
          U is COMPLEX*16 array, dimension( P )
          solution vector U in the GLM problem.
[out]WORK
          WORK is COMPLEX*16 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
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 148 of file zglmts.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 rwork( * )
163  COMPLEX*16 a( lda, * ), af( lda, * ), b( ldb, * ),
164  $ bf( ldb, * ), d( * ), df( * ), u( * ),
165  $ work( lwork ), x( * )
166 * ..
167 * .. Parameters ..
168  DOUBLE PRECISION zero
169  parameter( zero = 0.0d+0 )
170  COMPLEX*16 cone
171  parameter( cone = 1.0d+0 )
172 * ..
173 * .. Local Scalars ..
174  INTEGER info
175  DOUBLE PRECISION anorm, bnorm, dnorm, eps, unfl, xnorm, ynorm
176 * ..
177 * .. External Functions ..
178  DOUBLE PRECISION dlamch, dzasum, zlange
179  EXTERNAL dlamch, dzasum, zlange
180 * ..
181 * .. External Subroutines ..
182 *
183  EXTERNAL zcopy, zgemv, zggglm, zlacpy
184 * ..
185 * .. Intrinsic Functions ..
186  INTRINSIC max
187 * ..
188 * .. Executable Statements ..
189 *
190  eps = dlamch( 'Epsilon' )
191  unfl = dlamch( 'Safe minimum' )
192  anorm = max( zlange( '1', n, m, a, lda, rwork ), unfl )
193  bnorm = max( zlange( '1', n, p, b, ldb, rwork ), unfl )
194 *
195 * Copy the matrices A and B to the arrays AF and BF,
196 * and the vector D the array DF.
197 *
198  CALL zlacpy( 'Full', n, m, a, lda, af, lda )
199  CALL zlacpy( 'Full', n, p, b, ldb, bf, ldb )
200  CALL zcopy( n, d, 1, df, 1 )
201 *
202 * Solve GLM problem
203 *
204  CALL zggglm( n, m, p, af, lda, bf, ldb, df, x, u, work, lwork,
205  $ info )
206 *
207 * Test the residual for the solution of LSE
208 *
209 * norm( d - A*x - B*u )
210 * RESULT = -----------------------------------------
211 * (norm(A)+norm(B))*(norm(x)+norm(u))*EPS
212 *
213  CALL zcopy( n, d, 1, df, 1 )
214  CALL zgemv( 'No transpose', n, m, -cone, a, lda, x, 1, cone, df,
215  $ 1 )
216 *
217  CALL zgemv( 'No transpose', n, p, -cone, b, ldb, u, 1, cone, df,
218  $ 1 )
219 *
220  dnorm = dzasum( n, df, 1 )
221  xnorm = dzasum( m, x, 1 ) + dzasum( p, u, 1 )
222  ynorm = anorm + bnorm
223 *
224  IF( xnorm.LE.zero ) THEN
225  result = zero
226  ELSE
227  result = ( ( dnorm / ynorm ) / xnorm ) / eps
228  END IF
229 *
230  RETURN
231 *
232 * End of ZGLMTS
233 *
subroutine zggglm(N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK, INFO)
ZGGGLM
Definition: zggglm.f:187
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
Definition: zcopy.f:83
subroutine zgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
ZGEMV
Definition: zgemv.f:160
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
Definition: zlacpy.f:105
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlange.f:117
double precision function dzasum(N, ZX, INCX)
DZASUM
Definition: dzasum.f:74
Here is the call graph for this function:
Here is the caller graph for this function: