CXML
cher2k, zher2k
Rank-2k update of a complex hermitian matrix
FORMAT
{C,Z}HER2K ( uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc )
Arguments
uplo character*1
On entry, specifies whether the upper- or lower-
triangular part of the Hermitian matrix C is to be
referenced:
If uplo = 'U' or 'u', the upper-triangular part of C is
to be referenced.
If uplo = 'L' or 'l', the lower-triangular part of C is
to be referenced.
On exit, uplo is unchanged.
trans character*1
On entry, specifies the operation to be performed:
If trans = 'N' or 'n', C = alpha * A*conjug_transp(B)
+ conjugate(alpha)B*conjug_transp(A) + beta*C)
If trans = 'C' or 'c', C = alpha*conjug_transp(A)*B +
conjugate(alpha)*conjug_transp(B)*A + beta*C)
On exit, trans is unchanged.
n integer*4
On entry, the order of the matrix C; n >= 0
On exit, n is unchanged.
k integer*4
On entry, the number of columns of the matrices A and
B when trans = 'N' or the number of rows of the
matrices A and B when trans = 'C' or
On exit, k is unchanged.
alpha complex*8 | complex*16
On entry, specifies the scalar alpha.
On exit, alpha is unchanged.
a complex*8 | complex*16
On entry, a two-dimensional array A with dimensions lda
by ka.
For trans = 'N' or ka >= k and the leading n by k
portion of the array A contains the matrix A.
For trans = 'C' or ka >= n and the leading k by n part
of the array A contains the matrix A.
On exit, a is unchanged.
lda integer*4
On entry, the first dimension of array A.
For trans = 'N' or lda >= MAX(1,n).
For trans = 'C' or lda >= MAX(1,k).
On exit, lda is unchanged.
b complex*8 | complex*16
On entry, a two-dimensional array B with dimensions ldb
by kb.
For trans = 'N' or kb >= k and the leading n by k
portion of the array B contains the matrix B.
For trans = 'C' or kb >= n and the leading k by n part
of the array B contains the matrix B.
On exit, b is unchanged.
ldb integer*4
For trans = 'N' or 'n' ldb >= MAX(1,n).
For trans = 'C' or ldb >= MAX(1,k).
On exit, ldb is unchanged.
beta real*4 | real*8
On entry, specifies the scalar beta.
On exit, beta is unchanged.
c complex*8 | complex*16
On entry, a two-dimensional array C of dimensions ldc
by at least n.
If uplo specifies the upper part, the leading n by n upper-triangular part
of the array C must contain the upper-triangular part of the Hermitian
matrix C, and the strictly lower-triangular part of C is not referenced.
If uplo specifies the lower part, the leading n by n lower-triangular part
of the array C must contain the lower-triangular part of the Hermitian
matrix C, and the strictly upper-triangular part of C is not referenced.
The imaginary parts of the diagonal elements need not be set. They are
assumed to be 0, and on exit, they are set to 0.
On exit, c is overwritten; the triangular part of the array C is
overwritten by the triangular part of the updated matrix.
ldc integer*4
On entry, the first dimension of array C; ldc >=
MAX(1,n)
On exit, ldc is unchanged.
Description
CHER2K and ZHER2K perform the rank-2k update of a complex Hermitian matrix:
C = alpha * A*conjug_transp(B) + conjugate(alpha)*B*conjug_transp(A)
+ beta*C C = alpha*conjug_transp(A)*B +
conjugate(alpha)*conjug_transp(B)*A + beta*C
where alpha is a complex scalar, beta is a real scalar, and C is an n by n
Hermitian matrix. In the first case, A and B are n by k matrices, and in
the second case, they are k by n matrices.
Example
COMPLEX*8 A(40,10), B(40,10), C(20,20), alpha
REAL*4 beta
LDA = 40
LDB = 30
LDC = 20
N = 18
K = 10
alpha = (1.0, 1.0)
beta = (2.0)
CALL CHER2K ('U','N',N,K,alpha,A,LDA,B,LDB,beta,C,LDC)
This FORTRAN code computes the rank-2k update of the complex Hermitian
matrix C: C = alpha * A*conjug_transp(B) +
conjugate(alpha)B*conjug_transp(A) + beta*C). Only the upper-triangular
part of C is referenced. The leading 18 by 10 part of array A contains the
matrix A. The leading 18 by 10 part of array B contains the matrix B. The
leading 18 by 18 upper-triangular part of array C contains the upper-
triangular matrix C.
CXML Home Page Index of CXML Routines