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

◆ cpadmat()

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

Definition at line 9696 of file blacstest.f.

9698*
9699* -- BLACS tester (version 1.0) --
9700* University of Tennessee
9701* December 15, 1994
9702*
9703* .. Scalar Arguments ..
9704 CHARACTER*1 UPLO, DIAG
9705 INTEGER M, N, LDA, IPRE, IPOST
9706 COMPLEX CHECKVAL
9707* ..
9708* .. Array Arguments ..
9709 COMPLEX MEM( * )
9710* ..
9711*
9712* Purpose
9713* =======
9714*
9715* CPADMAT: Pad Matrix.
9716* This routines surrounds a matrix with a guardzone initialized to the
9717* value CHECKVAL. There are three distinct guardzones:
9718* - A contiguous zone of size IPRE immediately before the start
9719* of the matrix.
9720* - A contiguous zone of size IPOST immedately after the end of the
9721* matrix.
9722* - Interstitial zones within each column of the matrix, in the
9723* elements A( M+1:LDA, J ).
9724*
9725* Arguments
9726* =========
9727* UPLO (input) CHARACTER*1
9728* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
9729* rectangular?
9730*
9731* DIAG (input) CHARACTER*1
9732* For trapezoidal matrices, is the main diagonal included
9733* ('N') or not ('U')?
9734*
9735* M (input) INTEGER
9736* The number of rows of the matrix A. M >= 0.
9737*
9738* N (input) INTEGER
9739* The number of columns of the matrix A. N >= 0.
9740*
9741* MEM (output) complex array, dimension (IPRE+IPOST+LDA*N)
9742* The address IPRE elements ahead of the matrix A you want to
9743* pad, which is then of dimension (LDA,N).
9744*
9745* IPRE (input) INTEGER
9746* The size of the guard zone ahead of the matrix A.
9747*
9748* IPOST (input) INTEGER
9749* The size of the guard zone behind the matrix A.
9750*
9751* CHECKVAL (input) complex
9752* The value to insert into the guard zones.
9753*
9754* ====================================================================
9755*
9756* .. Local Scalars ..
9757 INTEGER I, J, K
9758* ..
9759* .. Executable Statements ..
9760*
9761* Put check buffer in front of A
9762*
9763 IF( ipre .GT. 0 ) THEN
9764 DO 10 i = 1, ipre
9765 mem( i ) = checkval
9766 10 CONTINUE
9767 END IF
9768*
9769* Put check buffer in back of A
9770*
9771 IF( ipost .GT. 0 ) THEN
9772 j = ipre + lda*n + 1
9773 DO 20 i = j, j+ipost-1
9774 mem( i ) = checkval
9775 20 CONTINUE
9776 END IF
9777*
9778* Put check buffer in all (LDA-M) gaps
9779*
9780 IF( lda .GT. m ) THEN
9781 k = ipre + m + 1
9782 DO 40 j = 1, n
9783 DO 30 i = k, k+lda-m-1
9784 mem( i ) = checkval
9785 30 CONTINUE
9786 k = k + lda
9787 40 CONTINUE
9788 END IF
9789*
9790* If the matrix is upper or lower trapezoidal, calculate the
9791* additional triangular area which needs to be padded, Each
9792* element referred to is in the Ith row and the Jth column.
9793*
9794 IF( uplo .EQ. 'U' ) THEN
9795 IF( m .LE. n ) THEN
9796 IF( diag .EQ. 'U' ) THEN
9797 DO 41 i = 1, m
9798 DO 42 j = 1, i
9799 k = ipre + i + (j-1)*lda
9800 mem( k ) = checkval
9801 42 CONTINUE
9802 41 CONTINUE
9803 ELSE
9804 DO 43 i = 2, m
9805 DO 44 j = 1, i-1
9806 k = ipre + i + (j-1)*lda
9807 mem( k ) = checkval
9808 44 CONTINUE
9809 43 CONTINUE
9810 END IF
9811 ELSE
9812 IF( diag .EQ. 'U' ) THEN
9813 DO 45 i = m-n+1, m
9814 DO 46 j = 1, i-(m-n)
9815 k = ipre + i + (j-1)*lda
9816 mem( k ) = checkval
9817 46 CONTINUE
9818 45 CONTINUE
9819 ELSE
9820 DO 47 i = m-n+2, m
9821 DO 48 j = 1, i-(m-n)-1
9822 k = ipre + i + (j-1)*lda
9823 mem( k ) = checkval
9824 48 CONTINUE
9825 47 CONTINUE
9826 END IF
9827 END IF
9828 ELSE IF( uplo .EQ. 'L' ) THEN
9829 IF( m .LE. n ) THEN
9830 IF( diag .EQ. 'U' ) THEN
9831 DO 49 i = 1, m
9832 DO 50 j = n-m+i, n
9833 k = ipre + i + (j-1)*lda
9834 mem( k ) = checkval
9835 50 CONTINUE
9836 49 CONTINUE
9837 ELSE
9838 DO 51 i = 1, m-1
9839 DO 52 j = n-m+i+1, n
9840 k = ipre + i + (j-1)*lda
9841 mem( k ) = checkval
9842 52 CONTINUE
9843 51 CONTINUE
9844 END IF
9845 ELSE
9846 IF( uplo .EQ. 'U' ) THEN
9847 DO 53 i = 1, n
9848 DO 54 j = i, n
9849 k = ipre + i + (j-1)*lda
9850 mem( k ) = checkval
9851 54 CONTINUE
9852 53 CONTINUE
9853 ELSE
9854 DO 55 i = 1, n-1
9855 DO 56 j = i+1, n
9856 k = ipre + i + (j-1)*lda
9857 mem( k ) = checkval
9858 56 CONTINUE
9859 55 CONTINUE
9860 END IF
9861 END IF
9862 END IF
9863*
9864* End of CPADMAT.
9865*
9866 RETURN
Here is the caller graph for this function: