SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dchkmat()

subroutine dchkmat ( character*1  uplo,
character*1  diag,
integer  m,
integer  n,
double precision, dimension(lda,n)  a,
integer  lda,
integer  rsrc,
integer  csrc,
integer  myrow,
integer  mycol,
integer  testnum,
integer  maxerr,
integer  nerr,
integer, dimension(6, maxerr)  erribuf,
double precision, dimension(2, maxerr)  errdbuf 
)

Definition at line 9068 of file blacstest.f.

9071*
9072* -- BLACS tester (version 1.0) --
9073* University of Tennessee
9074* December 15, 1994
9075*
9076*
9077* .. Scalar Arguments ..
9078 CHARACTER*1 UPLO, DIAG
9079 INTEGER M, N, LDA, RSRC, CSRC, MYROW, MYCOL, TESTNUM
9080 INTEGER MAXERR, NERR
9081* ..
9082* .. Array Arguments ..
9083 INTEGER ERRIBUF(6, MAXERR)
9084 DOUBLE PRECISION A(LDA,N), ERRDBUF(2, MAXERR)
9085* ..
9086*
9087* Purpose
9088* =======
9089* dCHKMAT: Check matrix to see whether there were any transmission
9090* errors.
9091*
9092* Arguments
9093* =========
9094* UPLO (input) CHARACTER*1
9095* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
9096* rectangular?
9097*
9098* DIAG (input) CHARACTER*1
9099* For trapezoidal matrices, is the main diagonal included
9100* ('N') or not ('U')?
9101*
9102* M (input) INTEGER
9103* The number of rows of the matrix A. M >= 0.
9104*
9105* N (input) INTEGER
9106* The number of columns of the matrix A. N >= 0.
9107*
9108* A (input) @up@(doctype) array, dimension (LDA,N)
9109* The m by n matrix A. Fortran77 (column-major) storage
9110* assumed.
9111*
9112* LDA (input) INTEGER
9113* The leading dimension of the array A. LDA >= max(1, M).
9114*
9115* RSRC (input) INTEGER
9116* The process row of the source of the matrix.
9117*
9118* CSRC (input) INTEGER
9119* The process column of the source of the matrix.
9120*
9121* MYROW (input) INTEGER
9122* Row of this process in the process grid.
9123*
9124* MYCOL (input) INTEGER
9125* Column of this process in the process grid.
9126*
9127*
9128* TESTNUM (input) INTEGER
9129* The number of the test being checked.
9130*
9131* MAXERR (input) INTEGER
9132* Max number of errors that can be stored in ERRIBUFF or
9133* ERRDBUFF
9134*
9135* NERR (output) INTEGER
9136* The number of errors that have been found.
9137*
9138* ERRIBUF (output) INTEGER array, dimension (6,MAXERRS)
9139* Buffer in which to store integer error information. It will
9140* be built up in the following format for the call to TSEND.
9141* All integer information is recorded in the following 6-tuple
9142* {TESTNUM, SRC, DEST, I, J, WHAT}. These values are figured:
9143* SRC = RSRC * NPROCS + CSRC
9144* DEST = RDEST * NPROCS + CDEST
9145* WHAT
9146* = 1 : Error in pre-padding
9147* = 2 : Error in post-padding
9148* = 3 : Error in LDA-M gap
9149* = 4 : Error in complementory triangle
9150* ELSE: Error in matrix
9151* If there are more errors than can fit in the error buffer,
9152* the error number will indicate the actual number of errors
9153* found, but the buffer will be truncated to the maximum
9154* number of errors which can fit.
9155*
9156* ERRDBUF (output) @(doctype) array, dimension (2, MAXERRS)
9157* Buffer in which to store error data information.
9158* {Incorrect, Predicted}
9159*
9160* ===================================================================
9161*
9162* .. Local Scalars ..
9163 INTEGER I, J, NPROCS, SRC, DEST
9164 LOGICAL USEIT
9165 DOUBLE PRECISION COMPVAL
9166* ..
9167* .. Local Arrays ..
9168 INTEGER ISEED(4)
9169* ..
9170* .. External Functions ..
9171 INTEGER IBTNPROCS
9172 DOUBLE PRECISION DBTRAN
9173 EXTERNAL dbtran, ibtnprocs
9174* ..
9175* .. Executable Statements ..
9176*
9177 nprocs = ibtnprocs()
9178 src = rsrc * nprocs + csrc
9179 dest = myrow * nprocs + mycol
9180*
9181* Initialize ISEED with the same values as used in DGENMAT.
9182*
9183 iseed(1) = mod( 1002 + testnum*5 + src*3, 4096 )
9184 iseed(2) = mod( 2027 + testnum*7 + src, 4096 )
9185 iseed(3) = mod( 1234 + testnum + src*3, 4096 )
9186 iseed(4) = mod( 4311 + testnum*10 + src*2, 4096 )
9187*
9188* Generate the elements randomly with the same method used in GENMAT.
9189* Note that for trapezoidal matrices, we generate all elements in the
9190* enclosing rectangle and then ignore the complementary triangle.
9191*
9192 DO 100 j = 1, n
9193 DO 105 i = 1, m
9194 compval = dbtran( iseed )
9195*
9196* Now determine whether we actually need this value. The
9197* strategy is to chop out the proper triangle based on what
9198* particular kind of trapezoidal matrix we're dealing with.
9199*
9200 useit = .true.
9201 IF( uplo .EQ. 'U' ) THEN
9202 IF( m .LE. n ) THEN
9203 IF( diag .EQ. 'U' ) THEN
9204 IF( i .GE. j ) THEN
9205 useit = .false.
9206 END IF
9207 ELSE
9208 IF( i .GT. j ) THEN
9209 useit = .false.
9210 END IF
9211 END IF
9212 ELSE
9213 IF( diag .EQ. 'U' ) THEN
9214 IF( i .GE. m-n+j ) THEN
9215 useit = .false.
9216 END IF
9217 ELSE
9218 IF( i .GT. m-n+j ) THEN
9219 useit = .false.
9220 END IF
9221 END IF
9222 END IF
9223 ELSE IF( uplo .EQ. 'L' ) THEN
9224 IF( m .LE. n ) THEN
9225 IF( diag .EQ. 'U' ) THEN
9226 IF( j. ge. i+(n-m) ) THEN
9227 useit = .false.
9228 END IF
9229 ELSE
9230 IF( j .GT. i+(n-m) ) THEN
9231 useit = .false.
9232 END IF
9233 END IF
9234 ELSE
9235 IF( diag .EQ. 'U' ) THEN
9236 IF( j .GE. i ) THEN
9237 useit = .false.
9238 END IF
9239 ELSE
9240 IF( j .GT. i ) THEN
9241 useit = .false.
9242 END IF
9243 END IF
9244 END IF
9245 END IF
9246*
9247* Compare the generated value to the one that's in the
9248* received matrix. If they don't match, tack another
9249* error record onto what's already there.
9250*
9251 IF( useit ) THEN
9252 IF( a(i,j) .NE. compval ) THEN
9253 nerr = nerr + 1
9254 IF( nerr .LE. maxerr ) THEN
9255 erribuf(1, nerr) = testnum
9256 erribuf(2, nerr) = src
9257 erribuf(3, nerr) = dest
9258 erribuf(4, nerr) = i
9259 erribuf(5, nerr) = j
9260 erribuf(6, nerr) = 5
9261 errdbuf(1, nerr) = a(i, j)
9262 errdbuf(2, nerr) = compval
9263 END IF
9264 END IF
9265 END IF
9266 105 CONTINUE
9267 100 CONTINUE
9268 RETURN
9269*
9270* End of DCHKMAT.
9271*
double precision function dbtran(iseed)
Definition blacstest.f:8619
integer function ibtnprocs()
Definition btprim.f:81