LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dsymm ( character  SIDE,
character  UPLO,
integer  M,
integer  N,
double precision  ALPHA,
double precision, dimension(lda,*)  A,
integer  LDA,
double precision, dimension(ldb,*)  B,
integer  LDB,
double precision  BETA,
double precision, dimension(ldc,*)  C,
integer  LDC 
)

DSYMM

Purpose:
 DSYMM  performs one of the matrix-matrix operations

    C := alpha*A*B + beta*C,

 or

    C := alpha*B*A + beta*C,

 where alpha and beta are scalars,  A is a symmetric matrix and  B and
 C are  m by n matrices.
Parameters
[in]SIDE
          SIDE is CHARACTER*1
           On entry,  SIDE  specifies whether  the  symmetric matrix  A
           appears on the  left or right  in the  operation as follows:

              SIDE = 'L' or 'l'   C := alpha*A*B + beta*C,

              SIDE = 'R' or 'r'   C := alpha*B*A + beta*C,
[in]UPLO
          UPLO is CHARACTER*1
           On  entry,   UPLO  specifies  whether  the  upper  or  lower
           triangular  part  of  the  symmetric  matrix   A  is  to  be
           referenced as follows:

              UPLO = 'U' or 'u'   Only the upper triangular part of the
                                  symmetric matrix is to be referenced.

              UPLO = 'L' or 'l'   Only the lower triangular part of the
                                  symmetric matrix is to be referenced.
[in]M
          M is INTEGER
           On entry,  M  specifies the number of rows of the matrix  C.
           M  must be at least zero.
[in]N
          N is INTEGER
           On entry, N specifies the number of columns of the matrix C.
           N  must be at least zero.
[in]ALPHA
          ALPHA is DOUBLE PRECISION.
           On entry, ALPHA specifies the scalar alpha.
[in]A
          A is DOUBLE PRECISION array of DIMENSION ( LDA, ka ), where ka is
           m  when  SIDE = 'L' or 'l'  and is  n otherwise.
           Before entry  with  SIDE = 'L' or 'l',  the  m by m  part of
           the array  A  must contain the  symmetric matrix,  such that
           when  UPLO = 'U' or 'u', the leading m by m upper triangular
           part of the array  A  must contain the upper triangular part
           of the  symmetric matrix and the  strictly  lower triangular
           part of  A  is not referenced,  and when  UPLO = 'L' or 'l',
           the leading  m by m  lower triangular part  of the  array  A
           must  contain  the  lower triangular part  of the  symmetric
           matrix and the  strictly upper triangular part of  A  is not
           referenced.
           Before entry  with  SIDE = 'R' or 'r',  the  n by n  part of
           the array  A  must contain the  symmetric matrix,  such that
           when  UPLO = 'U' or 'u', the leading n by n upper triangular
           part of the array  A  must contain the upper triangular part
           of the  symmetric matrix and the  strictly  lower triangular
           part of  A  is not referenced,  and when  UPLO = 'L' or 'l',
           the leading  n by n  lower triangular part  of the  array  A
           must  contain  the  lower triangular part  of the  symmetric
           matrix and the  strictly upper triangular part of  A  is not
           referenced.
[in]LDA
          LDA is INTEGER
           On entry, LDA specifies the first dimension of A as declared
           in the calling (sub) program.  When  SIDE = 'L' or 'l'  then
           LDA must be at least  max( 1, m ), otherwise  LDA must be at
           least  max( 1, n ).
[in]B
          B is DOUBLE PRECISION array of DIMENSION ( LDB, n ).
           Before entry, the leading  m by n part of the array  B  must
           contain the matrix B.
[in]LDB
          LDB is INTEGER
           On entry, LDB specifies the first dimension of B as declared
           in  the  calling  (sub)  program.   LDB  must  be  at  least
           max( 1, m ).
[in]BETA
          BETA is DOUBLE PRECISION.
           On entry,  BETA  specifies the scalar  beta.  When  BETA  is
           supplied as zero then C need not be set on input.
[in,out]C
          C is DOUBLE PRECISION array of DIMENSION ( LDC, n ).
           Before entry, the leading  m by n  part of the array  C must
           contain the matrix  C,  except when  beta  is zero, in which
           case C need not be set on entry.
           On exit, the array  C  is overwritten by the  m by n updated
           matrix.
[in]LDC
          LDC is INTEGER
           On entry, LDC specifies the first dimension of C as declared
           in  the  calling  (sub)  program.   LDC  must  be  at  least
           max( 1, m ).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011
Further Details:
  Level 3 Blas routine.

  -- Written on 8-February-1989.
     Jack Dongarra, Argonne National Laboratory.
     Iain Duff, AERE Harwell.
     Jeremy Du Croz, Numerical Algorithms Group Ltd.
     Sven Hammarling, Numerical Algorithms Group Ltd.

Definition at line 191 of file dsymm.f.

191 *
192 * -- Reference BLAS level3 routine (version 3.4.0) --
193 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
194 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
195 * November 2011
196 *
197 * .. Scalar Arguments ..
198  DOUBLE PRECISION alpha,beta
199  INTEGER lda,ldb,ldc,m,n
200  CHARACTER side,uplo
201 * ..
202 * .. Array Arguments ..
203  DOUBLE PRECISION a(lda,*),b(ldb,*),c(ldc,*)
204 * ..
205 *
206 * =====================================================================
207 *
208 * .. External Functions ..
209  LOGICAL lsame
210  EXTERNAL lsame
211 * ..
212 * .. External Subroutines ..
213  EXTERNAL xerbla
214 * ..
215 * .. Intrinsic Functions ..
216  INTRINSIC max
217 * ..
218 * .. Local Scalars ..
219  DOUBLE PRECISION temp1,temp2
220  INTEGER i,info,j,k,nrowa
221  LOGICAL upper
222 * ..
223 * .. Parameters ..
224  DOUBLE PRECISION one,zero
225  parameter(one=1.0d+0,zero=0.0d+0)
226 * ..
227 *
228 * Set NROWA as the number of rows of A.
229 *
230  IF (lsame(side,'L')) THEN
231  nrowa = m
232  ELSE
233  nrowa = n
234  END IF
235  upper = lsame(uplo,'U')
236 *
237 * Test the input parameters.
238 *
239  info = 0
240  IF ((.NOT.lsame(side,'L')) .AND. (.NOT.lsame(side,'R'))) THEN
241  info = 1
242  ELSE IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,'L'))) THEN
243  info = 2
244  ELSE IF (m.LT.0) THEN
245  info = 3
246  ELSE IF (n.LT.0) THEN
247  info = 4
248  ELSE IF (lda.LT.max(1,nrowa)) THEN
249  info = 7
250  ELSE IF (ldb.LT.max(1,m)) THEN
251  info = 9
252  ELSE IF (ldc.LT.max(1,m)) THEN
253  info = 12
254  END IF
255  IF (info.NE.0) THEN
256  CALL xerbla('DSYMM ',info)
257  RETURN
258  END IF
259 *
260 * Quick return if possible.
261 *
262  IF ((m.EQ.0) .OR. (n.EQ.0) .OR.
263  + ((alpha.EQ.zero).AND. (beta.EQ.one))) RETURN
264 *
265 * And when alpha.eq.zero.
266 *
267  IF (alpha.EQ.zero) THEN
268  IF (beta.EQ.zero) THEN
269  DO 20 j = 1,n
270  DO 10 i = 1,m
271  c(i,j) = zero
272  10 CONTINUE
273  20 CONTINUE
274  ELSE
275  DO 40 j = 1,n
276  DO 30 i = 1,m
277  c(i,j) = beta*c(i,j)
278  30 CONTINUE
279  40 CONTINUE
280  END IF
281  RETURN
282  END IF
283 *
284 * Start the operations.
285 *
286  IF (lsame(side,'L')) THEN
287 *
288 * Form C := alpha*A*B + beta*C.
289 *
290  IF (upper) THEN
291  DO 70 j = 1,n
292  DO 60 i = 1,m
293  temp1 = alpha*b(i,j)
294  temp2 = zero
295  DO 50 k = 1,i - 1
296  c(k,j) = c(k,j) + temp1*a(k,i)
297  temp2 = temp2 + b(k,j)*a(k,i)
298  50 CONTINUE
299  IF (beta.EQ.zero) THEN
300  c(i,j) = temp1*a(i,i) + alpha*temp2
301  ELSE
302  c(i,j) = beta*c(i,j) + temp1*a(i,i) +
303  + alpha*temp2
304  END IF
305  60 CONTINUE
306  70 CONTINUE
307  ELSE
308  DO 100 j = 1,n
309  DO 90 i = m,1,-1
310  temp1 = alpha*b(i,j)
311  temp2 = zero
312  DO 80 k = i + 1,m
313  c(k,j) = c(k,j) + temp1*a(k,i)
314  temp2 = temp2 + b(k,j)*a(k,i)
315  80 CONTINUE
316  IF (beta.EQ.zero) THEN
317  c(i,j) = temp1*a(i,i) + alpha*temp2
318  ELSE
319  c(i,j) = beta*c(i,j) + temp1*a(i,i) +
320  + alpha*temp2
321  END IF
322  90 CONTINUE
323  100 CONTINUE
324  END IF
325  ELSE
326 *
327 * Form C := alpha*B*A + beta*C.
328 *
329  DO 170 j = 1,n
330  temp1 = alpha*a(j,j)
331  IF (beta.EQ.zero) THEN
332  DO 110 i = 1,m
333  c(i,j) = temp1*b(i,j)
334  110 CONTINUE
335  ELSE
336  DO 120 i = 1,m
337  c(i,j) = beta*c(i,j) + temp1*b(i,j)
338  120 CONTINUE
339  END IF
340  DO 140 k = 1,j - 1
341  IF (upper) THEN
342  temp1 = alpha*a(k,j)
343  ELSE
344  temp1 = alpha*a(j,k)
345  END IF
346  DO 130 i = 1,m
347  c(i,j) = c(i,j) + temp1*b(i,k)
348  130 CONTINUE
349  140 CONTINUE
350  DO 160 k = j + 1,n
351  IF (upper) THEN
352  temp1 = alpha*a(j,k)
353  ELSE
354  temp1 = alpha*a(k,j)
355  END IF
356  DO 150 i = 1,m
357  c(i,j) = c(i,j) + temp1*b(i,k)
358  150 CONTINUE
359  160 CONTINUE
360  170 CONTINUE
361  END IF
362 *
363  RETURN
364 *
365 * End of DSYMM .
366 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: