LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ zhemm()

subroutine zhemm ( 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 
)

ZHEMM

Purpose:
 ZHEMM  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 an hermitian matrix and  B and
 C are m by n matrices.
Parameters
[in]SIDE
          SIDE is CHARACTER*1
           On entry,  SIDE  specifies whether  the  hermitian 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  hermitian  matrix   A  is  to  be
           referenced as follows:

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

              UPLO = 'L' or 'l'   Only the lower triangular part of the
                                  hermitian 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  hermitian 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  hermitian 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  hermitian
           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  hermitian 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  hermitian 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  hermitian
           matrix and the  strictly upper triangular part of  A  is not
           referenced.
           Note that the imaginary parts  of the diagonal elements need
           not be set, they are assumed to be zero.
[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.
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 193 of file zhemm.f.

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