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

◆ zpadmat()

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

Definition at line 10764 of file blacstest.f.

10766*
10767* -- BLACS tester (version 1.0) --
10768* University of Tennessee
10769* December 15, 1994
10770*
10771* .. Scalar Arguments ..
10772 CHARACTER*1 UPLO, DIAG
10773 INTEGER M, N, LDA, IPRE, IPOST
10774 DOUBLE COMPLEX CHECKVAL
10775* ..
10776* .. Array Arguments ..
10777 DOUBLE COMPLEX MEM( * )
10778* ..
10779*
10780* Purpose
10781* =======
10782*
10783* ZPADMAT: Pad Matrix.
10784* This routines surrounds a matrix with a guardzone initialized to the
10785* value CHECKVAL. There are three distinct guardzones:
10786* - A contiguous zone of size IPRE immediately before the start
10787* of the matrix.
10788* - A contiguous zone of size IPOST immedately after the end of the
10789* matrix.
10790* - Interstitial zones within each column of the matrix, in the
10791* elements A( M+1:LDA, J ).
10792*
10793* Arguments
10794* =========
10795* UPLO (input) CHARACTER*1
10796* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
10797* rectangular?
10798*
10799* DIAG (input) CHARACTER*1
10800* For trapezoidal matrices, is the main diagonal included
10801* ('N') or not ('U')?
10802*
10803* M (input) INTEGER
10804* The number of rows of the matrix A. M >= 0.
10805*
10806* N (input) INTEGER
10807* The number of columns of the matrix A. N >= 0.
10808*
10809* MEM (output) double complex array, dimension (IPRE+IPOST+LDA*N)
10810* The address IPRE elements ahead of the matrix A you want to
10811* pad, which is then of dimension (LDA,N).
10812*
10813* IPRE (input) INTEGER
10814* The size of the guard zone ahead of the matrix A.
10815*
10816* IPOST (input) INTEGER
10817* The size of the guard zone behind the matrix A.
10818*
10819* CHECKVAL (input) double complex
10820* The value to insert into the guard zones.
10821*
10822* ====================================================================
10823*
10824* .. Local Scalars ..
10825 INTEGER I, J, K
10826* ..
10827* .. Executable Statements ..
10828*
10829* Put check buffer in front of A
10830*
10831 IF( ipre .GT. 0 ) THEN
10832 DO 10 i = 1, ipre
10833 mem( i ) = checkval
10834 10 CONTINUE
10835 END IF
10836*
10837* Put check buffer in back of A
10838*
10839 IF( ipost .GT. 0 ) THEN
10840 j = ipre + lda*n + 1
10841 DO 20 i = j, j+ipost-1
10842 mem( i ) = checkval
10843 20 CONTINUE
10844 END IF
10845*
10846* Put check buffer in all (LDA-M) gaps
10847*
10848 IF( lda .GT. m ) THEN
10849 k = ipre + m + 1
10850 DO 40 j = 1, n
10851 DO 30 i = k, k+lda-m-1
10852 mem( i ) = checkval
10853 30 CONTINUE
10854 k = k + lda
10855 40 CONTINUE
10856 END IF
10857*
10858* If the matrix is upper or lower trapezoidal, calculate the
10859* additional triangular area which needs to be padded, Each
10860* element referred to is in the Ith row and the Jth column.
10861*
10862 IF( uplo .EQ. 'U' ) THEN
10863 IF( m .LE. n ) THEN
10864 IF( diag .EQ. 'U' ) THEN
10865 DO 41 i = 1, m
10866 DO 42 j = 1, i
10867 k = ipre + i + (j-1)*lda
10868 mem( k ) = checkval
10869 42 CONTINUE
10870 41 CONTINUE
10871 ELSE
10872 DO 43 i = 2, m
10873 DO 44 j = 1, i-1
10874 k = ipre + i + (j-1)*lda
10875 mem( k ) = checkval
10876 44 CONTINUE
10877 43 CONTINUE
10878 END IF
10879 ELSE
10880 IF( diag .EQ. 'U' ) THEN
10881 DO 45 i = m-n+1, m
10882 DO 46 j = 1, i-(m-n)
10883 k = ipre + i + (j-1)*lda
10884 mem( k ) = checkval
10885 46 CONTINUE
10886 45 CONTINUE
10887 ELSE
10888 DO 47 i = m-n+2, m
10889 DO 48 j = 1, i-(m-n)-1
10890 k = ipre + i + (j-1)*lda
10891 mem( k ) = checkval
10892 48 CONTINUE
10893 47 CONTINUE
10894 END IF
10895 END IF
10896 ELSE IF( uplo .EQ. 'L' ) THEN
10897 IF( m .LE. n ) THEN
10898 IF( diag .EQ. 'U' ) THEN
10899 DO 49 i = 1, m
10900 DO 50 j = n-m+i, n
10901 k = ipre + i + (j-1)*lda
10902 mem( k ) = checkval
10903 50 CONTINUE
10904 49 CONTINUE
10905 ELSE
10906 DO 51 i = 1, m-1
10907 DO 52 j = n-m+i+1, n
10908 k = ipre + i + (j-1)*lda
10909 mem( k ) = checkval
10910 52 CONTINUE
10911 51 CONTINUE
10912 END IF
10913 ELSE
10914 IF( uplo .EQ. 'U' ) THEN
10915 DO 53 i = 1, n
10916 DO 54 j = i, n
10917 k = ipre + i + (j-1)*lda
10918 mem( k ) = checkval
10919 54 CONTINUE
10920 53 CONTINUE
10921 ELSE
10922 DO 55 i = 1, n-1
10923 DO 56 j = i+1, n
10924 k = ipre + i + (j-1)*lda
10925 mem( k ) = checkval
10926 56 CONTINUE
10927 55 CONTINUE
10928 END IF
10929 END IF
10930 END IF
10931*
10932* End of ZPADMAT.
10933*
10934 RETURN