Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?her2

Performs a rank-2 update of a Hermitian matrix.

Syntax

call cher2(uplo, n, alpha, x, incx, y, incy, a, lda)

call zher2(uplo, n, alpha, x, incx, y, incy, a, lda)

call her2(a, x, y [,uplo][,alpha])

Include Files

  • mkl.fi, blas.f90

Description

The ?her2 routines perform a matrix-vector operation defined as

A := alpha *x*conjg(y') + conjg(alpha)*y *conjg(x') + A,

where:

alpha is scalar,

x and y are n-element vectors,

A is an n-by-n Hermitian matrix.

Input Parameters

uplo

CHARACTER*1. Specifies whether the upper or lower triangular part of the array a is used.

If uplo = 'U' or 'u', then the upper triangular of the array a is used.

If uplo = 'L' or 'l', then the low triangular of the array a is used.

n

INTEGER. Specifies the order of the matrix A. The value of n must be at least zero.

alpha

COMPLEX for cher2

DOUBLE COMPLEX for zher2

Specifies the scalar alpha.

x

COMPLEX for cher2

DOUBLE COMPLEX for zher2

Array, size at least (1 + (n - 1)*abs(incx)). Before entry, the incremented array x must contain the n-element vector x.

incx

INTEGER. Specifies the increment for the elements of x.

The value of incx must not be zero.

y

COMPLEX for cher2

DOUBLE COMPLEX for zher2

Array, size at least (1 + (n - 1)*abs(incy)). Before entry, the incremented array y must contain the n-element vector y.

incy

INTEGER. Specifies the increment for the elements of y.

The value of incy must not be zero.

a

COMPLEX for cher2

DOUBLE COMPLEX for zher2

Array, size (lda, n).

Before entry with 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.

Before entry with 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.

The imaginary parts of the diagonal elements need not be set and are assumed to be zero.

lda

INTEGER. Specifies the leading dimension of a as declared in the calling (sub)program. The value of lda must be at least max(1, n).

Output Parameters

a

With uplo = 'U' or 'u', the upper triangular part of the array a is overwritten by the upper triangular part of the updated matrix.

With uplo = 'L' or 'l', the lower triangular part of the array a is overwritten by the lower triangular part of the updated matrix.

If alpha is zero, matrix A is unchanged; otherwise, the imaginary parts of the diagonal elements are set to zero.

BLAS 95 Interface Notes

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see BLAS 95 Interface Conventions.

Specific details for the routine her2 interface are the following:

a

Holds the matrix A of size (n,n).

x

Holds the vector with the number of elements n.

y

Holds the vector with the number of elements n.

uplo

Must be 'U' or 'L'. The default value is 'U'.

alpha

The default value is 1.