F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06WQF (ZHFRK)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

F06WQF (ZHFRK) performs one of the Hermitian rank-$k$ update operations
 $C←αAAH + βC or C←αAHA + βC ,$
where $A$ is a real matrix, $C$ is an $n$ by $n$ complex Hermitian matrix stored in Rectangular Full Packed (RFP) format, and $\alpha$ and $\beta$ are real scalars. The RFP storage format is described in Section 3.3.3 in the F07 Chapter Introduction.

## 2  Specification

 SUBROUTINE F06WQF ( TRANSR, UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C)
 INTEGER N, K, LDA REAL (KIND=nag_wp) ALPHA, BETA COMPLEX (KIND=nag_wp) A(LDA,*), C(N*(N+1)/2) CHARACTER(1) TRANSR, UPLO, TRANS
The routine may be called by its LAPACK name zhfrk.

None.

None.

## 5  Parameters

1:     TRANSR – CHARACTER(1)Input
On entry: specifies whether the normal RFP representation of $C$ or its conjugate transpose is stored.
${\mathbf{TRANSR}}=\text{'N'}$
The matrix $C$ is stored in normal RFP format.
${\mathbf{TRANSR}}=\text{'C'}$
The conjugate transpose of the RFP representation of the matrix $C$ is stored.
Constraint: ${\mathbf{TRANSR}}=\text{'N'}$ or $\text{'C'}$.
2:     UPLO – CHARACTER(1)Input
On entry: specifies whether the upper or lower triangular part of $C$ is stored in RFP format.
${\mathbf{UPLO}}=\text{'U'}$
The upper triangular part of $C$ is stored in RFP format.
${\mathbf{UPLO}}=\text{'L'}$
The lower triangular part of $C$ is stored in RFP format.
Constraint: ${\mathbf{UPLO}}=\text{'U'}$ or $\text{'L'}$.
3:     TRANS – CHARACTER(1)Input
On entry: specifies the operation to be performed.
${\mathbf{TRANS}}=\text{'N'}$
$C←\alpha A{A}^{\mathrm{H}}+\beta C$.
${\mathbf{TRANS}}=\text{'C'}$
$C←\alpha {A}^{\mathrm{H}}A+\beta C$.
Constraint: ${\mathbf{TRANS}}=\text{'N'}$ or $\text{'C'}$.
4:     N – INTEGERInput
On entry: $n$, the order of the matrix $C$.
Constraint: ${\mathbf{N}}\ge 0$.
5:     K – INTEGERInput
On entry: $k$, the number of columns of $A$ if ${\mathbf{TRANS}}=\text{'N'}$, or the number of rows of $A$ if ${\mathbf{TRANS}}=\text{'C'}$.
Constraint: ${\mathbf{K}}\ge 0$.
6:     ALPHA – REAL (KIND=nag_wp)Input
On entry: the scalar $\alpha$.
7:     A(LDA,$*$) – COMPLEX (KIND=nag_wp) arrayInput
Note: the second dimension of the array A must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{K}}\right)$ if ${\mathbf{TRANS}}=\text{'N'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$ if ${\mathbf{TRANS}}=\text{'C'}$.
On entry: the matrix $A$; $A$ is $n$ by $k$ if ${\mathbf{TRANS}}=\text{'N'}$, or $k$ by $n$ if ${\mathbf{TRANS}}=\text{'C'}$.
8:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F06WQF (ZHFRK) is called.
Constraints:
• if ${\mathbf{TRANS}}=\text{'N'}$, ${\mathbf{LDA}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$;
• if ${\mathbf{TRANS}}=\text{'C'}$, ${\mathbf{LDA}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{K}}\right)$.
9:     BETA – REAL (KIND=nag_wp)Input
On entry: the scalar $\beta$.
10:   C(${\mathbf{N}}×\left({\mathbf{N}}+1\right)/2$) – COMPLEX (KIND=nag_wp) arrayInput/Output
On entry: the upper or lower triangular part (as specified by UPLO) of the $n$ by $n$ symmetric matrix $C$, stored in RFP format, as described in Section 3.3.3 in the F07 Chapter Introduction.
On exit: the updated matrix $C$, that is its upper or lower triangular part stored in RFP format.

None.

Not applicable.

None.

## 9  Example

This example reads in the lower triangular part of a symmetric matrix $C$ which it converts to RFP format. It also reads in $\alpha$, $\beta$ and a $4$ by $3$ matrix $A$ and then performs the Hermitian rank-$3$ update $C←\alpha A{A}^{\mathrm{H}}+\beta C$.

### 9.1  Program Text

Program Text (f06wqfe.f90)

### 9.2  Program Data

Program Data (f06wqfe.d)

### 9.3  Program Results

Program Results (f06wqfe.r)