# NAG Library Routine Document

## 1Purpose

f06fqf generates a sequence of real plane rotations.

## 2Specification

Fortran Interface
 Subroutine f06fqf ( n, x, incx, c, s)
 Integer, Intent (In) :: n, incx Real (Kind=nag_wp), Intent (Inout) :: alpha, x(*) Real (Kind=nag_wp), Intent (Out) :: c(n), s(n) Character (1), Intent (In) :: pivot, direct
#include <nagmk26.h>
 void f06fqf_ (const char *pivot, const char *direct, const Integer *n, double *alpha, double x[], const Integer *incx, double c[], double s[], const Charlen length_pivot, const Charlen length_direct)

## 3Description

f06fqf generates the parameters of a real orthogonal matrix $P$, of order $n+1$, chosen so as to set to zero the elements of a supplied $n$-element real 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 real 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 sk -sk ck .$
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}$ – IntegerInput
On entry: $n$, the number of elements in $x$.
4:     $\mathbf{alpha}$ – Real (Kind=nag_wp)Input/Output
On entry: the scalar $\alpha$.
On exit: the scalar $\beta$.
5:     $\mathbf{x}\left(*\right)$ – Real (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 sequence of plane rotations.
6:     $\mathbf{incx}$ – IntegerInput
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) arrayOutput
On exit: the values ${c}_{k}$, the cosines of the rotations.
8:     $\mathbf{s}\left({\mathbf{n}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: the values ${s}_{k}$, the sines of the rotations.

None.

Not applicable.

## 8Parallelism and Performance

f06fqf is not threaded in any implementation.