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

◆ cchkmat()

subroutine cchkmat ( character*1  uplo,
character*1  diag,
integer  m,
integer  n,
complex, 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,
complex, dimension(2, maxerr)  errdbuf 
)

Definition at line 10130 of file blacstest.f.

10133*
10134* -- BLACS tester (version 1.0) --
10135* University of Tennessee
10136* December 15, 1994
10137*
10138*
10139* .. Scalar Arguments ..
10140 CHARACTER*1 UPLO, DIAG
10141 INTEGER M, N, LDA, RSRC, CSRC, MYROW, MYCOL, TESTNUM
10142 INTEGER MAXERR, NERR
10143* ..
10144* .. Array Arguments ..
10145 INTEGER ERRIBUF(6, MAXERR)
10146 COMPLEX A(LDA,N), ERRDBUF(2, MAXERR)
10147* ..
10148*
10149* Purpose
10150* =======
10151* cCHKMAT: Check matrix to see whether there were any transmission
10152* errors.
10153*
10154* Arguments
10155* =========
10156* UPLO (input) CHARACTER*1
10157* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
10158* rectangular?
10159*
10160* DIAG (input) CHARACTER*1
10161* For trapezoidal matrices, is the main diagonal included
10162* ('N') or not ('U')?
10163*
10164* M (input) INTEGER
10165* The number of rows of the matrix A. M >= 0.
10166*
10167* N (input) INTEGER
10168* The number of columns of the matrix A. N >= 0.
10169*
10170* A (input) @up@(doctype) array, dimension (LDA,N)
10171* The m by n matrix A. Fortran77 (column-major) storage
10172* assumed.
10173*
10174* LDA (input) INTEGER
10175* The leading dimension of the array A. LDA >= max(1, M).
10176*
10177* RSRC (input) INTEGER
10178* The process row of the source of the matrix.
10179*
10180* CSRC (input) INTEGER
10181* The process column of the source of the matrix.
10182*
10183* MYROW (input) INTEGER
10184* Row of this process in the process grid.
10185*
10186* MYCOL (input) INTEGER
10187* Column of this process in the process grid.
10188*
10189*
10190* TESTNUM (input) INTEGER
10191* The number of the test being checked.
10192*
10193* MAXERR (input) INTEGER
10194* Max number of errors that can be stored in ERRIBUFF or
10195* ERRCBUFF
10196*
10197* NERR (output) INTEGER
10198* The number of errors that have been found.
10199*
10200* ERRIBUF (output) INTEGER array, dimension (6,MAXERRS)
10201* Buffer in which to store integer error information. It will
10202* be built up in the following format for the call to TSEND.
10203* All integer information is recorded in the following 6-tuple
10204* {TESTNUM, SRC, DEST, I, J, WHAT}. These values are figured:
10205* SRC = RSRC * NPROCS + CSRC
10206* DEST = RDEST * NPROCS + CDEST
10207* WHAT
10208* = 1 : Error in pre-padding
10209* = 2 : Error in post-padding
10210* = 3 : Error in LDA-M gap
10211* = 4 : Error in complementory triangle
10212* ELSE: Error in matrix
10213* If there are more errors than can fit in the error buffer,
10214* the error number will indicate the actual number of errors
10215* found, but the buffer will be truncated to the maximum
10216* number of errors which can fit.
10217*
10218* ERRDBUF (output) @(doctype) array, dimension (2, MAXERRS)
10219* Buffer in which to store error data information.
10220* {Incorrect, Predicted}
10221*
10222* ===================================================================
10223*
10224* .. Local Scalars ..
10225 INTEGER I, J, NPROCS, SRC, DEST
10226 LOGICAL USEIT
10227 COMPLEX COMPVAL
10228* ..
10229* .. Local Arrays ..
10230 INTEGER ISEED(4)
10231* ..
10232* .. External Functions ..
10233 INTEGER IBTNPROCS
10234 COMPLEX CBTRAN
10235 EXTERNAL cbtran, ibtnprocs
10236* ..
10237* .. Executable Statements ..
10238*
10239 nprocs = ibtnprocs()
10240 src = rsrc * nprocs + csrc
10241 dest = myrow * nprocs + mycol
10242*
10243* Initialize ISEED with the same values as used in CGENMAT.
10244*
10245 iseed(1) = mod( 1002 + testnum*5 + src*3, 4096 )
10246 iseed(2) = mod( 2027 + testnum*7 + src, 4096 )
10247 iseed(3) = mod( 1234 + testnum + src*3, 4096 )
10248 iseed(4) = mod( 4311 + testnum*10 + src*2, 4096 )
10249*
10250* Generate the elements randomly with the same method used in GENMAT.
10251* Note that for trapezoidal matrices, we generate all elements in the
10252* enclosing rectangle and then ignore the complementary triangle.
10253*
10254 DO 100 j = 1, n
10255 DO 105 i = 1, m
10256 compval = cbtran( iseed )
10257*
10258* Now determine whether we actually need this value. The
10259* strategy is to chop out the proper triangle based on what
10260* particular kind of trapezoidal matrix we're dealing with.
10261*
10262 useit = .true.
10263 IF( uplo .EQ. 'U' ) THEN
10264 IF( m .LE. n ) THEN
10265 IF( diag .EQ. 'U' ) THEN
10266 IF( i .GE. j ) THEN
10267 useit = .false.
10268 END IF
10269 ELSE
10270 IF( i .GT. j ) THEN
10271 useit = .false.
10272 END IF
10273 END IF
10274 ELSE
10275 IF( diag .EQ. 'U' ) THEN
10276 IF( i .GE. m-n+j ) THEN
10277 useit = .false.
10278 END IF
10279 ELSE
10280 IF( i .GT. m-n+j ) THEN
10281 useit = .false.
10282 END IF
10283 END IF
10284 END IF
10285 ELSE IF( uplo .EQ. 'L' ) THEN
10286 IF( m .LE. n ) THEN
10287 IF( diag .EQ. 'U' ) THEN
10288 IF( j. ge. i+(n-m) ) THEN
10289 useit = .false.
10290 END IF
10291 ELSE
10292 IF( j .GT. i+(n-m) ) THEN
10293 useit = .false.
10294 END IF
10295 END IF
10296 ELSE
10297 IF( diag .EQ. 'U' ) THEN
10298 IF( j .GE. i ) THEN
10299 useit = .false.
10300 END IF
10301 ELSE
10302 IF( j .GT. i ) THEN
10303 useit = .false.
10304 END IF
10305 END IF
10306 END IF
10307 END IF
10308*
10309* Compare the generated value to the one that's in the
10310* received matrix. If they don't match, tack another
10311* error record onto what's already there.
10312*
10313 IF( useit ) THEN
10314 IF( a(i,j) .NE. compval ) THEN
10315 nerr = nerr + 1
10316 IF( nerr .LE. maxerr ) THEN
10317 erribuf(1, nerr) = testnum
10318 erribuf(2, nerr) = src
10319 erribuf(3, nerr) = dest
10320 erribuf(4, nerr) = i
10321 erribuf(5, nerr) = j
10322 erribuf(6, nerr) = 5
10323 errdbuf(1, nerr) = a(i, j)
10324 errdbuf(2, nerr) = compval
10325 END IF
10326 END IF
10327 END IF
10328 105 CONTINUE
10329 100 CONTINUE
10330 RETURN
10331*
10332* End of CCHKMAT.
10333*
complex function cbtran(iseed)
Definition blacstest.f:9683
integer function ibtnprocs()
Definition btprim.f:81