ScaLAPACK  2.0.2 ScaLAPACK: Scalable Linear Algebra PACKage
immdda.f
Go to the documentation of this file.
```00001       SUBROUTINE IMMDDA( M, N, ALPHA, A, LDA, BETA, B, LDB )
00002 *
00003 *  -- PBLAS auxiliary routine (version 2.0) --
00004 *     University of Tennessee, Knoxville, Oak Ridge National Laboratory,
00005 *     and University of California, Berkeley.
00006 *     April 1, 1998
00007 *
00008 *     .. Scalar Arguments ..
00009       INTEGER            LDA, LDB, M, N
00010       INTEGER            ALPHA, BETA
00011 *     ..
00012 *     .. Array Arguments ..
00013       INTEGER            A( LDA, * ), B( LDB, * )
00014 *     ..
00015 *
00016 *  Purpose
00017 *  =======
00018 *
00019 *  IMMDDA performs the following operation:
00020 *
00021 *     A := alpha * A + beta * B,
00022 *
00023 *  where alpha, beta are scalars and A and B are m by n matrices.
00024 *
00025 *  Arguments
00026 *  =========
00027 *
00028 *  M       (local input) INTEGER
00029 *          On entry, M  specifies the number of rows of A and B. M  must
00030 *          be at least zero.
00031 *
00032 *  N       (local input) INTEGER
00033 *          On entry, N  specifies  the  number  of  columns  of A and B.
00034 *          N must be at least zero.
00035 *
00036 *  ALPHA   (local input) INTEGER
00037 *          On entry,  ALPHA  specifies the scalar alpha. When  ALPHA  is
00038 *          supplied as zero then the local entries of the array  A  need
00039 *          not be set on input.
00040 *
00041 *  A       (local input/local output) INTEGER array
00042 *          On entry, A is an array of dimension ( LDA, N ). On exit, the
00043 *          leading m by n part of B has been added to the leading m by n
00044 *          part of A.
00045 *
00046 *  LDA     (local input) INTEGER
00047 *          On entry, LDA specifies the leading dimension of the array A.
00048 *          LDA must be at least max( 1, M ).
00049 *
00050 *  BETA    (local input) INTEGER
00051 *          On entry,  BETA  specifies the scalar beta. When BETA is sup-
00052 *          plied as zero then the local entries of the array B need  not
00053 *          be set on input.
00054 *
00055 *  B       (local input) INTEGER array
00056 *          On entry, B is an array of dimension ( LDB, N ).
00057 *
00058 *  LDB     (local input) INTEGER
00059 *          On entry, LDB specifies the leading dimension of the array B.
00060 *          LDB must be at least max( 1, M ).
00061 *
00062 *  -- Written on April 1, 1998 by
00063 *     Antoine Petitet, University  of  Tennessee, Knoxville 37996, USA.
00064 *
00065 *  =====================================================================
00066 *
00067 *     .. Parameters ..
00068       INTEGER            ONE, ZERO
00069       PARAMETER          ( ONE = 1, ZERO = 0 )
00070 *     ..
00071 *     .. Local Scalars ..
00072       INTEGER            I, J
00073 *     ..
00074 *     .. Executable Statements ..
00075 *
00076       IF( BETA.EQ.ONE ) THEN
00077          IF( ALPHA.EQ.ZERO ) THEN
00078             DO 20 J = 1, N
00079                DO 10 I = 1, M
00080                   A( I, J ) = B( I, J )
00081    10          CONTINUE
00082    20       CONTINUE
00083          ELSE IF( ALPHA.NE.ONE ) THEN
00084             DO 40 J = 1, N
00085                DO 30 I = 1, M
00086                   A( I, J ) = B( I, J ) + ALPHA * A( I, J )
00087    30          CONTINUE
00088    40       CONTINUE
00089          ELSE
00090             DO 60 J = 1, N
00091                DO 50 I = 1, M
00092                   A( I, J ) = B( I, J ) + A( I, J )
00093    50          CONTINUE
00094    60       CONTINUE
00095          END IF
00096       ELSE IF( BETA.NE.ZERO ) THEN
00097          IF( ALPHA.EQ.ZERO ) THEN
00098             DO 80 J = 1, N
00099                DO 70 I = 1, M
00100                   A( I, J ) = BETA * B( I, J )
00101    70          CONTINUE
00102    80       CONTINUE
00103          ELSE IF( ALPHA.NE.ONE ) THEN
00104             DO 100 J = 1, N
00105                DO 90 I = 1, M
00106                   A( I, J ) = BETA * B( I, J ) + ALPHA * A( I, J )
00107    90          CONTINUE
00108   100       CONTINUE
00109          ELSE
00110             DO 120 J = 1, N
00111                DO 110 I = 1, M
00112                   A( I, J ) = BETA * B( I, J ) + A( I, J )
00113   110          CONTINUE
00114   120       CONTINUE
00115          END IF
00116       ELSE
00117          IF( ALPHA.EQ.ZERO ) THEN
00118             DO 140 J = 1, N
00119                DO 130 I = 1, M
00120                   A( I, J ) = ZERO
00121   130          CONTINUE
00122   140       CONTINUE
00123          ELSE IF( ALPHA.NE.ONE ) THEN
00124             DO 160 J = 1, N
00125                DO 150 I = 1, M
00126                   A( I, J ) = ALPHA * A( I, J )
00127   150          CONTINUE
00128   160       CONTINUE
00129          END IF
00130       END IF
00131 *
00132       RETURN
00133 *
00134 *     End of IMMDDA
00135 *
00136       END
```