LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dqrt17()

double precision function dqrt17 ( character  TRANS,
integer  IRESID,
integer  M,
integer  N,
integer  NRHS,
double precision, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( ldx, * )  X,
integer  LDX,
double precision, dimension( ldb, * )  B,
integer  LDB,
double precision, dimension( ldb, * )  C,
double precision, dimension( lwork )  WORK,
integer  LWORK 
)

DQRT17

Purpose:
 DQRT17 computes the ratio

    || R'*op(A) ||/(||A||*alpha*max(M,N,NRHS)*eps)

 where R = op(A)*X - B, op(A) is A or A', and

    alpha = ||B|| if IRESID = 1 (zero-residual problem)
    alpha = ||R|| if IRESID = 2 (otherwise).
Parameters
[in]TRANS
          TRANS is CHARACTER*1
          Specifies whether or not the transpose of A is used.
          = 'N':  No transpose, op(A) = A.
          = 'T':  Transpose, op(A) = A'.
[in]IRESID
          IRESID is INTEGER
          IRESID = 1 indicates zero-residual problem.
          IRESID = 2 indicates non-zero residual.
[in]M
          M is INTEGER
          The number of rows of the matrix A.
          If TRANS = 'N', the number of rows of the matrix B.
          If TRANS = 'T', the number of rows of the matrix X.
[in]N
          N is INTEGER
          The number of columns of the matrix  A.
          If TRANS = 'N', the number of rows of the matrix X.
          If TRANS = 'T', the number of rows of the matrix B.
[in]NRHS
          NRHS is INTEGER
          The number of columns of the matrices X and B.
[in]A
          A is DOUBLE PRECISION array, dimension (LDA,N)
          The m-by-n matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A. LDA >= M.
[in]X
          X is DOUBLE PRECISION array, dimension (LDX,NRHS)
          If TRANS = 'N', the n-by-nrhs matrix X.
          If TRANS = 'T', the m-by-nrhs matrix X.
[in]LDX
          LDX is INTEGER
          The leading dimension of the array X.
          If TRANS = 'N', LDX >= N.
          If TRANS = 'T', LDX >= M.
[in]B
          B is DOUBLE PRECISION array, dimension (LDB,NRHS)
          If TRANS = 'N', the m-by-nrhs matrix B.
          If TRANS = 'T', the n-by-nrhs matrix B.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.
          If TRANS = 'N', LDB >= M.
          If TRANS = 'T', LDB >= N.
[out]C
          C is DOUBLE PRECISION array, dimension (LDB,NRHS)
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (LWORK)
[in]LWORK
          LWORK is INTEGER
          The length of the array WORK.  LWORK >= NRHS*(M+N).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 152 of file dqrt17.f.

152 *
153 * -- LAPACK test routine (version 3.7.0) --
154 * -- LAPACK is a software package provided by Univ. of Tennessee, --
155 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
156 * December 2016
157 *
158 * .. Scalar Arguments ..
159  CHARACTER trans
160  INTEGER iresid, lda, ldb, ldx, lwork, m, n, nrhs
161 * ..
162 * .. Array Arguments ..
163  DOUBLE PRECISION a( lda, * ), b( ldb, * ), c( ldb, * ),
164  $ work( lwork ), x( ldx, * )
165 * ..
166 *
167 * =====================================================================
168 *
169 * .. Parameters ..
170  DOUBLE PRECISION zero, one
171  parameter( zero = 0.0d0, one = 1.0d0 )
172 * ..
173 * .. Local Scalars ..
174  INTEGER info, iscl, ncols, nrows
175  DOUBLE PRECISION bignum, err, norma, normb, normrs, smlnum
176 * ..
177 * .. Local Arrays ..
178  DOUBLE PRECISION rwork( 1 )
179 * ..
180 * .. External Functions ..
181  LOGICAL lsame
182  DOUBLE PRECISION dlamch, dlange
183  EXTERNAL lsame, dlamch, dlange
184 * ..
185 * .. External Subroutines ..
186  EXTERNAL dgemm, dlacpy, dlascl, xerbla
187 * ..
188 * .. Intrinsic Functions ..
189  INTRINSIC dble, max
190 * ..
191 * .. Executable Statements ..
192 *
193  dqrt17 = zero
194 *
195  IF( lsame( trans, 'N' ) ) THEN
196  nrows = m
197  ncols = n
198  ELSE IF( lsame( trans, 'T' ) ) THEN
199  nrows = n
200  ncols = m
201  ELSE
202  CALL xerbla( 'DQRT17', 1 )
203  RETURN
204  END IF
205 *
206  IF( lwork.LT.ncols*nrhs ) THEN
207  CALL xerbla( 'DQRT17', 13 )
208  RETURN
209  END IF
210 *
211  IF( m.LE.0 .OR. n.LE.0 .OR. nrhs.LE.0 ) THEN
212  RETURN
213  END IF
214 *
215  norma = dlange( 'One-norm', m, n, a, lda, rwork )
216  smlnum = dlamch( 'Safe minimum' ) / dlamch( 'Precision' )
217  bignum = one / smlnum
218  iscl = 0
219 *
220 * compute residual and scale it
221 *
222  CALL dlacpy( 'All', nrows, nrhs, b, ldb, c, ldb )
223  CALL dgemm( trans, 'No transpose', nrows, nrhs, ncols, -one, a,
224  $ lda, x, ldx, one, c, ldb )
225  normrs = dlange( 'Max', nrows, nrhs, c, ldb, rwork )
226  IF( normrs.GT.smlnum ) THEN
227  iscl = 1
228  CALL dlascl( 'General', 0, 0, normrs, one, nrows, nrhs, c, ldb,
229  $ info )
230  END IF
231 *
232 * compute R'*A
233 *
234  CALL dgemm( 'Transpose', trans, nrhs, ncols, nrows, one, c, ldb,
235  $ a, lda, zero, work, nrhs )
236 *
237 * compute and properly scale error
238 *
239  err = dlange( 'One-norm', nrhs, ncols, work, nrhs, rwork )
240  IF( norma.NE.zero )
241  $ err = err / norma
242 *
243  IF( iscl.EQ.1 )
244  $ err = err*normrs
245 *
246  IF( iresid.EQ.1 ) THEN
247  normb = dlange( 'One-norm', nrows, nrhs, b, ldb, rwork )
248  IF( normb.NE.zero )
249  $ err = err / normb
250  ELSE
251  IF( normrs.NE.zero )
252  $ err = err / normrs
253  END IF
254 *
255  dqrt17 = err / ( dlamch( 'Epsilon' )*dble( max( m, n, nrhs ) ) )
256  RETURN
257 *
258 * End of DQRT17
259 *
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 dlascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
DLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
Definition: dlascl.f:145
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DGEMM
Definition: dgemm.f:189
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
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
double precision function dqrt17(TRANS, IRESID, M, N, NRHS, A, LDA, X, LDX, B, LDB, C, WORK, LWORK)
DQRT17
Definition: dqrt17.f:152
Here is the call graph for this function: