LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ zsymm()

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

ZSYMM

Purpose:
 ZSYMM  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*16
           On entry, ALPHA specifies the scalar alpha.
[in]A
          A is COMPLEX*16 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*16 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*16
           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*16 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.
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 188 of file zsymm.f.

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