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

◆ spadmat()

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

Definition at line 7570 of file blacstest.f.

7572*
7573* -- BLACS tester (version 1.0) --
7574* University of Tennessee
7575* December 15, 1994
7576*
7577* .. Scalar Arguments ..
7578 CHARACTER*1 UPLO, DIAG
7579 INTEGER M, N, LDA, IPRE, IPOST
7580 REAL CHECKVAL
7581* ..
7582* .. Array Arguments ..
7583 REAL MEM( * )
7584* ..
7585*
7586* Purpose
7587* =======
7588*
7589* SPADMAT: Pad Matrix.
7590* This routines surrounds a matrix with a guardzone initialized to the
7591* value CHECKVAL. There are three distinct guardzones:
7592* - A contiguous zone of size IPRE immediately before the start
7593* of the matrix.
7594* - A contiguous zone of size IPOST immedately after the end of the
7595* matrix.
7596* - Interstitial zones within each column of the matrix, in the
7597* elements A( M+1:LDA, J ).
7598*
7599* Arguments
7600* =========
7601* UPLO (input) CHARACTER*1
7602* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
7603* rectangular?
7604*
7605* DIAG (input) CHARACTER*1
7606* For trapezoidal matrices, is the main diagonal included
7607* ('N') or not ('U')?
7608*
7609* M (input) INTEGER
7610* The number of rows of the matrix A. M >= 0.
7611*
7612* N (input) INTEGER
7613* The number of columns of the matrix A. N >= 0.
7614*
7615* MEM (output) real array, dimension (IPRE+IPOST+LDA*N)
7616* The address IPRE elements ahead of the matrix A you want to
7617* pad, which is then of dimension (LDA,N).
7618*
7619* IPRE (input) INTEGER
7620* The size of the guard zone ahead of the matrix A.
7621*
7622* IPOST (input) INTEGER
7623* The size of the guard zone behind the matrix A.
7624*
7625* CHECKVAL (input) real
7626* The value to insert into the guard zones.
7627*
7628* ====================================================================
7629*
7630* .. Local Scalars ..
7631 INTEGER I, J, K
7632* ..
7633* .. Executable Statements ..
7634*
7635* Put check buffer in front of A
7636*
7637 IF( ipre .GT. 0 ) THEN
7638 DO 10 i = 1, ipre
7639 mem( i ) = checkval
7640 10 CONTINUE
7641 END IF
7642*
7643* Put check buffer in back of A
7644*
7645 IF( ipost .GT. 0 ) THEN
7646 j = ipre + lda*n + 1
7647 DO 20 i = j, j+ipost-1
7648 mem( i ) = checkval
7649 20 CONTINUE
7650 END IF
7651*
7652* Put check buffer in all (LDA-M) gaps
7653*
7654 IF( lda .GT. m ) THEN
7655 k = ipre + m + 1
7656 DO 40 j = 1, n
7657 DO 30 i = k, k+lda-m-1
7658 mem( i ) = checkval
7659 30 CONTINUE
7660 k = k + lda
7661 40 CONTINUE
7662 END IF
7663*
7664* If the matrix is upper or lower trapezoidal, calculate the
7665* additional triangular area which needs to be padded, Each
7666* element referred to is in the Ith row and the Jth column.
7667*
7668 IF( uplo .EQ. 'U' ) THEN
7669 IF( m .LE. n ) THEN
7670 IF( diag .EQ. 'U' ) THEN
7671 DO 41 i = 1, m
7672 DO 42 j = 1, i
7673 k = ipre + i + (j-1)*lda
7674 mem( k ) = checkval
7675 42 CONTINUE
7676 41 CONTINUE
7677 ELSE
7678 DO 43 i = 2, m
7679 DO 44 j = 1, i-1
7680 k = ipre + i + (j-1)*lda
7681 mem( k ) = checkval
7682 44 CONTINUE
7683 43 CONTINUE
7684 END IF
7685 ELSE
7686 IF( diag .EQ. 'U' ) THEN
7687 DO 45 i = m-n+1, m
7688 DO 46 j = 1, i-(m-n)
7689 k = ipre + i + (j-1)*lda
7690 mem( k ) = checkval
7691 46 CONTINUE
7692 45 CONTINUE
7693 ELSE
7694 DO 47 i = m-n+2, m
7695 DO 48 j = 1, i-(m-n)-1
7696 k = ipre + i + (j-1)*lda
7697 mem( k ) = checkval
7698 48 CONTINUE
7699 47 CONTINUE
7700 END IF
7701 END IF
7702 ELSE IF( uplo .EQ. 'L' ) THEN
7703 IF( m .LE. n ) THEN
7704 IF( diag .EQ. 'U' ) THEN
7705 DO 49 i = 1, m
7706 DO 50 j = n-m+i, n
7707 k = ipre + i + (j-1)*lda
7708 mem( k ) = checkval
7709 50 CONTINUE
7710 49 CONTINUE
7711 ELSE
7712 DO 51 i = 1, m-1
7713 DO 52 j = n-m+i+1, n
7714 k = ipre + i + (j-1)*lda
7715 mem( k ) = checkval
7716 52 CONTINUE
7717 51 CONTINUE
7718 END IF
7719 ELSE
7720 IF( uplo .EQ. 'U' ) THEN
7721 DO 53 i = 1, n
7722 DO 54 j = i, n
7723 k = ipre + i + (j-1)*lda
7724 mem( k ) = checkval
7725 54 CONTINUE
7726 53 CONTINUE
7727 ELSE
7728 DO 55 i = 1, n-1
7729 DO 56 j = i+1, n
7730 k = ipre + i + (j-1)*lda
7731 mem( k ) = checkval
7732 56 CONTINUE
7733 55 CONTINUE
7734 END IF
7735 END IF
7736 END IF
7737*
7738* End of SPADMAT.
7739*
7740 RETURN
Here is the caller graph for this function: