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

◆ ipadmat()

subroutine ipadmat ( character*1  uplo,
character*1  diag,
integer  m,
integer  n,
integer, dimension( * )  mem,
integer  lda,
integer  ipre,
integer  ipost,
integer  checkval 
)

Definition at line 6506 of file blacstest.f.

6508*
6509* -- BLACS tester (version 1.0) --
6510* University of Tennessee
6511* December 15, 1994
6512*
6513* .. Scalar Arguments ..
6514 CHARACTER*1 UPLO, DIAG
6515 INTEGER M, N, LDA, IPRE, IPOST
6516 INTEGER CHECKVAL
6517* ..
6518* .. Array Arguments ..
6519 INTEGER MEM( * )
6520* ..
6521*
6522* Purpose
6523* =======
6524*
6525* IPADMAT: Pad Matrix.
6526* This routines surrounds a matrix with a guardzone initialized to the
6527* value CHECKVAL. There are three distinct guardzones:
6528* - A contiguous zone of size IPRE immediately before the start
6529* of the matrix.
6530* - A contiguous zone of size IPOST immedately after the end of the
6531* matrix.
6532* - Interstitial zones within each column of the matrix, in the
6533* elements A( M+1:LDA, J ).
6534*
6535* Arguments
6536* =========
6537* UPLO (input) CHARACTER*1
6538* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
6539* rectangular?
6540*
6541* DIAG (input) CHARACTER*1
6542* For trapezoidal matrices, is the main diagonal included
6543* ('N') or not ('U')?
6544*
6545* M (input) INTEGER
6546* The number of rows of the matrix A. M >= 0.
6547*
6548* N (input) INTEGER
6549* The number of columns of the matrix A. N >= 0.
6550*
6551* MEM (output) integer array, dimension (IPRE+IPOST+LDA*N)
6552* The address IPRE elements ahead of the matrix A you want to
6553* pad, which is then of dimension (LDA,N).
6554*
6555* IPRE (input) INTEGER
6556* The size of the guard zone ahead of the matrix A.
6557*
6558* IPOST (input) INTEGER
6559* The size of the guard zone behind the matrix A.
6560*
6561* CHECKVAL (input) integer
6562* The value to insert into the guard zones.
6563*
6564* ====================================================================
6565*
6566* .. Local Scalars ..
6567 INTEGER I, J, K
6568* ..
6569* .. Executable Statements ..
6570*
6571* Put check buffer in front of A
6572*
6573 IF( ipre .GT. 0 ) THEN
6574 DO 10 i = 1, ipre
6575 mem( i ) = checkval
6576 10 CONTINUE
6577 END IF
6578*
6579* Put check buffer in back of A
6580*
6581 IF( ipost .GT. 0 ) THEN
6582 j = ipre + lda*n + 1
6583 DO 20 i = j, j+ipost-1
6584 mem( i ) = checkval
6585 20 CONTINUE
6586 END IF
6587*
6588* Put check buffer in all (LDA-M) gaps
6589*
6590 IF( lda .GT. m ) THEN
6591 k = ipre + m + 1
6592 DO 40 j = 1, n
6593 DO 30 i = k, k+lda-m-1
6594 mem( i ) = checkval
6595 30 CONTINUE
6596 k = k + lda
6597 40 CONTINUE
6598 END IF
6599*
6600* If the matrix is upper or lower trapezoidal, calculate the
6601* additional triangular area which needs to be padded, Each
6602* element referred to is in the Ith row and the Jth column.
6603*
6604 IF( uplo .EQ. 'U' ) THEN
6605 IF( m .LE. n ) THEN
6606 IF( diag .EQ. 'U' ) THEN
6607 DO 41 i = 1, m
6608 DO 42 j = 1, i
6609 k = ipre + i + (j-1)*lda
6610 mem( k ) = checkval
6611 42 CONTINUE
6612 41 CONTINUE
6613 ELSE
6614 DO 43 i = 2, m
6615 DO 44 j = 1, i-1
6616 k = ipre + i + (j-1)*lda
6617 mem( k ) = checkval
6618 44 CONTINUE
6619 43 CONTINUE
6620 END IF
6621 ELSE
6622 IF( diag .EQ. 'U' ) THEN
6623 DO 45 i = m-n+1, m
6624 DO 46 j = 1, i-(m-n)
6625 k = ipre + i + (j-1)*lda
6626 mem( k ) = checkval
6627 46 CONTINUE
6628 45 CONTINUE
6629 ELSE
6630 DO 47 i = m-n+2, m
6631 DO 48 j = 1, i-(m-n)-1
6632 k = ipre + i + (j-1)*lda
6633 mem( k ) = checkval
6634 48 CONTINUE
6635 47 CONTINUE
6636 END IF
6637 END IF
6638 ELSE IF( uplo .EQ. 'L' ) THEN
6639 IF( m .LE. n ) THEN
6640 IF( diag .EQ. 'U' ) THEN
6641 DO 49 i = 1, m
6642 DO 50 j = n-m+i, n
6643 k = ipre + i + (j-1)*lda
6644 mem( k ) = checkval
6645 50 CONTINUE
6646 49 CONTINUE
6647 ELSE
6648 DO 51 i = 1, m-1
6649 DO 52 j = n-m+i+1, n
6650 k = ipre + i + (j-1)*lda
6651 mem( k ) = checkval
6652 52 CONTINUE
6653 51 CONTINUE
6654 END IF
6655 ELSE
6656 IF( uplo .EQ. 'U' ) THEN
6657 DO 53 i = 1, n
6658 DO 54 j = i, n
6659 k = ipre + i + (j-1)*lda
6660 mem( k ) = checkval
6661 54 CONTINUE
6662 53 CONTINUE
6663 ELSE
6664 DO 55 i = 1, n-1
6665 DO 56 j = i+1, n
6666 k = ipre + i + (j-1)*lda
6667 mem( k ) = checkval
6668 56 CONTINUE
6669 55 CONTINUE
6670 END IF
6671 END IF
6672 END IF
6673*
6674* End of IPADMAT.
6675*
6676 RETURN
Here is the caller graph for this function: