LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ csymm()

subroutine csymm ( character  SIDE,
character  UPLO,
integer  M,
integer  N,
complex  ALPHA,
complex, dimension(lda,*)  A,
integer  LDA,
complex, dimension(ldb,*)  B,
integer  LDB,
complex  BETA,
complex, dimension(ldc,*)  C,
integer  LDC 
)

CSYMM

Purpose:
 CSYMM  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 COMPLEX
           On entry, ALPHA specifies the scalar alpha.
[in]A
          A is COMPLEX array, 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 COMPLEX array, 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 COMPLEX
           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 COMPLEX array, 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
December 2016
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 csymm.f.

191 *
192 * -- Reference BLAS level3 routine (version 3.7.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 * December 2016
196 *
197 * .. Scalar Arguments ..
198  COMPLEX alpha,beta
199  INTEGER lda,ldb,ldc,m,n
200  CHARACTER side,uplo
201 * ..
202 * .. Array Arguments ..
203  COMPLEX 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  COMPLEX temp1,temp2
220  INTEGER i,info,j,k,nrowa
221  LOGICAL upper
222 * ..
223 * .. Parameters ..
224  COMPLEX one
225  parameter(one= (1.0e+0,0.0e+0))
226  COMPLEX zero
227  parameter(zero= (0.0e+0,0.0e+0))
228 * ..
229 *
230 * Set NROWA as the number of rows of A.
231 *
232  IF (lsame(side,'L')) THEN
233  nrowa = m
234  ELSE
235  nrowa = n
236  END IF
237  upper = lsame(uplo,'U')
238 *
239 * Test the input parameters.
240 *
241  info = 0
242  IF ((.NOT.lsame(side,'L')) .AND. (.NOT.lsame(side,'R'))) THEN
243  info = 1
244  ELSE IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,'L'))) THEN
245  info = 2
246  ELSE IF (m.LT.0) THEN
247  info = 3
248  ELSE IF (n.LT.0) THEN
249  info = 4
250  ELSE IF (lda.LT.max(1,nrowa)) THEN
251  info = 7
252  ELSE IF (ldb.LT.max(1,m)) THEN
253  info = 9
254  ELSE IF (ldc.LT.max(1,m)) THEN
255  info = 12
256  END IF
257  IF (info.NE.0) THEN
258  CALL xerbla('CSYMM ',info)
259  RETURN
260  END IF
261 *
262 * Quick return if possible.
263 *
264  IF ((m.EQ.0) .OR. (n.EQ.0) .OR.
265  + ((alpha.EQ.zero).AND. (beta.EQ.one))) RETURN
266 *
267 * And when alpha.eq.zero.
268 *
269  IF (alpha.EQ.zero) THEN
270  IF (beta.EQ.zero) THEN
271  DO 20 j = 1,n
272  DO 10 i = 1,m
273  c(i,j) = zero
274  10 CONTINUE
275  20 CONTINUE
276  ELSE
277  DO 40 j = 1,n
278  DO 30 i = 1,m
279  c(i,j) = beta*c(i,j)
280  30 CONTINUE
281  40 CONTINUE
282  END IF
283  RETURN
284  END IF
285 *
286 * Start the operations.
287 *
288  IF (lsame(side,'L')) THEN
289 *
290 * Form C := alpha*A*B + beta*C.
291 *
292  IF (upper) THEN
293  DO 70 j = 1,n
294  DO 60 i = 1,m
295  temp1 = alpha*b(i,j)
296  temp2 = zero
297  DO 50 k = 1,i - 1
298  c(k,j) = c(k,j) + temp1*a(k,i)
299  temp2 = temp2 + b(k,j)*a(k,i)
300  50 CONTINUE
301  IF (beta.EQ.zero) THEN
302  c(i,j) = temp1*a(i,i) + alpha*temp2
303  ELSE
304  c(i,j) = beta*c(i,j) + temp1*a(i,i) +
305  + alpha*temp2
306  END IF
307  60 CONTINUE
308  70 CONTINUE
309  ELSE
310  DO 100 j = 1,n
311  DO 90 i = m,1,-1
312  temp1 = alpha*b(i,j)
313  temp2 = zero
314  DO 80 k = i + 1,m
315  c(k,j) = c(k,j) + temp1*a(k,i)
316  temp2 = temp2 + b(k,j)*a(k,i)
317  80 CONTINUE
318  IF (beta.EQ.zero) THEN
319  c(i,j) = temp1*a(i,i) + alpha*temp2
320  ELSE
321  c(i,j) = beta*c(i,j) + temp1*a(i,i) +
322  + alpha*temp2
323  END IF
324  90 CONTINUE
325  100 CONTINUE
326  END IF
327  ELSE
328 *
329 * Form C := alpha*B*A + beta*C.
330 *
331  DO 170 j = 1,n
332  temp1 = alpha*a(j,j)
333  IF (beta.EQ.zero) THEN
334  DO 110 i = 1,m
335  c(i,j) = temp1*b(i,j)
336  110 CONTINUE
337  ELSE
338  DO 120 i = 1,m
339  c(i,j) = beta*c(i,j) + temp1*b(i,j)
340  120 CONTINUE
341  END IF
342  DO 140 k = 1,j - 1
343  IF (upper) THEN
344  temp1 = alpha*a(k,j)
345  ELSE
346  temp1 = alpha*a(j,k)
347  END IF
348  DO 130 i = 1,m
349  c(i,j) = c(i,j) + temp1*b(i,k)
350  130 CONTINUE
351  140 CONTINUE
352  DO 160 k = j + 1,n
353  IF (upper) THEN
354  temp1 = alpha*a(j,k)
355  ELSE
356  temp1 = alpha*a(k,j)
357  END IF
358  DO 150 i = 1,m
359  c(i,j) = c(i,j) + temp1*b(i,k)
360  150 CONTINUE
361  160 CONTINUE
362  170 CONTINUE
363  END IF
364 *
365  RETURN
366 *
367 * End of CSYMM .
368 *
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: