F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06HQF

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

F06HQF generates a sequence of complex plane rotations.

## 2  Specification

 SUBROUTINE F06HQF ( PIVOT, DIRECT, N, ALPHA, X, INCX, C, S)
 INTEGER N, INCX REAL (KIND=nag_wp) C(N) COMPLEX (KIND=nag_wp) ALPHA, X(*), S(N) CHARACTER(1) PIVOT, DIRECT

## 3  Description

F06HQF generates the parameters of a complex unitary matrix $P$, of order $n+1$, chosen so as to set to zero the elements of a supplied $n$-element complex vector $x$.
If ${\mathbf{PIVOT}}=\text{'F'}$ and ${\mathbf{DIRECT}}=\text{'F'}$, or if ${\mathbf{PIVOT}}=\text{'V'}$ and ${\mathbf{DIRECT}}=\text{'B'}$,
 $P α x = β 0 ;$
If ${\mathbf{PIVOT}}=\text{'F'}$ and ${\mathbf{DIRECT}}=\text{'B'}$, or if ${\mathbf{PIVOT}}=\text{'V'}$ and ${\mathbf{DIRECT}}=\text{'F'}$,
 $P x α = 0 β .$
Here $\alpha$ and $\beta$ are complex scalars.
$P$ is represented as a sequence of $n$ plane rotations ${P}_{k}$, as specified by PIVOT and DIRECT; ${P}_{k}$ is chosen to annihilate ${x}_{k}$, and its $2$ by $2$ plane rotation part has the form
 $ck s-k -sk ck ,$
with ${c}_{k}$ real. The tangent of the rotation, ${t}_{k}$, is overwritten on ${x}_{k}$.

None.

## 5  Parameters

1:     PIVOT – CHARACTER(1)Input
On entry: specifies the plane rotated by ${P}_{k}$.
${\mathbf{PIVOT}}=\text{'V'}$ (variable pivot)
${P}_{k}$ rotates the $\left(k,k+1\right)$ plane.
${\mathbf{PIVOT}}=\text{'F'}$ (fixed pivot)
${P}_{k}$ rotates the $\left(1,k+1\right)$ plane if ${\mathbf{DIRECT}}=\text{'F'}$, or the $\left(k,n+1\right)$ plane if ${\mathbf{DIRECT}}=\text{'B'}$.
Constraint: ${\mathbf{PIVOT}}=\text{'V'}$ or $\text{'F'}$.
2:     DIRECT – CHARACTER(1)Input
On entry: specifies the sequence direction.
${\mathbf{DIRECT}}=\text{'F'}$ (forward sequence)
$P={P}_{n}\cdots {P}_{2}{P}_{1}$.
${\mathbf{DIRECT}}=\text{'B'}$ (backward sequence)
$P={P}_{1}{P}_{2}\cdots {P}_{n}$.
Constraint: ${\mathbf{DIRECT}}=\text{'F'}$ or $\text{'B'}$.
3:     N – INTEGERInput
On entry: $n$, the number of elements in $x$.
4:     ALPHA – COMPLEX (KIND=nag_wp)Input/Output
On entry: the scalar $\alpha$.
On exit: the scalar $\beta$.
5:     X($*$) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the dimension of the array X must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{N}}-1\right)×{\mathbf{INCX}}\right)$.
On entry: the $n$-element vector $x$. ${x}_{\mathit{i}}$ must be stored in ${\mathbf{X}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{INCX}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
Intermediate elements of X are not referenced.
On exit: the referenced elements are overwritten by details of the plane rotations.
6:     INCX – INTEGERInput
On entry: the increment in the subscripts of X between successive elements of $x$.
Constraint: ${\mathbf{INCX}}>0$.
7:     C(N) – REAL (KIND=nag_wp) arrayOutput
On exit: the values ${c}_{k}$, the cosines of the rotations.
8:     S(N) – COMPLEX (KIND=nag_wp) arrayOutput
On exit: the values ${s}_{k}$, the sines of the rotations.

None.

Not applicable.