# NAG FL Interfacef06hqf (zsrotg)

## 1Purpose

f06hqf generates a sequence of complex plane rotations.

## 2Specification

Fortran Interface
 Subroutine f06hqf ( n, x, incx, c, s)
 Integer, Intent (In) :: n, incx Real (Kind=nag_wp), Intent (Out) :: c(n) Complex (Kind=nag_wp), Intent (Inout) :: alpha, x(*) Complex (Kind=nag_wp), Intent (Out) :: s(n) Character (1), Intent (In) :: pivot, direct
C Header Interface
#include <nag.h>
 void f06hqf_ (const char *pivot, const char *direct, const Integer *n, Complex *alpha, Complex x[], const Integer *incx, double c[], Complex s[], const Charlen length_pivot, const Charlen length_direct)
The routine may be called by the names f06hqf or nagf_blas_zsrotg.

## 3Description

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.

## 5Arguments

1: $\mathbf{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: $\mathbf{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: $\mathbf{n}$Integer Input
On entry: $n$, the number of elements in $x$.
4: $\mathbf{alpha}$Complex (Kind=nag_wp) Input/Output
On entry: the scalar $\alpha$.
On exit: the scalar $\beta$.
5: $\mathbf{x}\left(*\right)$Complex (Kind=nag_wp) array Input/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: $\mathbf{incx}$Integer Input
On entry: the increment in the subscripts of x between successive elements of $x$.
Constraint: ${\mathbf{incx}}>0$.
7: $\mathbf{c}\left({\mathbf{n}}\right)$Real (Kind=nag_wp) array Output
On exit: the values ${c}_{k}$, the cosines of the rotations.
8: $\mathbf{s}\left({\mathbf{n}}\right)$Complex (Kind=nag_wp) array Output
On exit: the values ${s}_{k}$, the sines of the rotations.

None.

Not applicable.

## 8Parallelism and Performance

f06hqf is not threaded in any implementation.

None.

None.