# NAG Library Routine Document

## 1Purpose

f06qxf applies a sequence of plane rotations to a real rectangular matrix.

## 2Specification

Fortran Interface
 Subroutine f06qxf ( side, m, n, k1, k2, c, s, a, lda)
 Integer, Intent (In) :: m, n, k1, k2, lda Real (Kind=nag_wp), Intent (In) :: c(k2-1), s(k2-1) Real (Kind=nag_wp), Intent (Inout) :: a(lda,*) Character (1), Intent (In) :: side, pivot, direct
#include nagmk26.h
 void f06qxf_ (const char *side, const char *pivot, const char *direct, const Integer *m, const Integer *n, const Integer *k1, const Integer *k2, const double c[], const double s[], double a[], const Integer *lda, const Charlen length_side, const Charlen length_pivot, const Charlen length_direct)

## 3Description

f06qxf performs the transformation
 $A←PA or A←APT ,$
where $A$ is an $m$ by $n$ real matrix and $P$ is a real orthogonal matrix, defined as a sequence of plane rotations, ${P}_{k}$, applied in planes ${k}_{1}$ to ${k}_{2}$.
The $2$ by $2$ plane rotation part of ${P}_{k}$ is assumed to have the form
 $ck sk -sk ck .$

None.

## 5Arguments

1:     $\mathbf{side}$ – Character(1)Input
On entry: specifies whether $A$ is operated on from the left or the right.
${\mathbf{side}}=\text{'L'}$
$A$ is pre-multiplied from the left.
${\mathbf{side}}=\text{'R'}$
$A$ is post-multiplied from the right.
Constraint: ${\mathbf{side}}=\text{'L'}$ or $\text{'R'}$.
2:     $\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{'T'}$ (top pivot)
${P}_{k}$ rotates the $\left({k}_{1},k+1\right)$ plane.
${\mathbf{pivot}}=\text{'B'}$ (bottom pivot)
${P}_{k}$ rotates the $\left(k,{k}_{2}\right)$ plane.
Constraint: ${\mathbf{pivot}}=\text{'V'}$, $\text{'T'}$ or $\text{'B'}$.
3:     $\mathbf{direct}$ – Character(1)Input
On entry: specifies the sequence direction.
${\mathbf{direct}}=\text{'F'}$ (forward sequence)
$P={P}_{{k}_{2}-1}\cdots {P}_{{k}_{1}+1}{P}_{{k}_{1}}$.
${\mathbf{direct}}=\text{'B'}$ (backward sequence)
$P={P}_{{k}_{1}}{P}_{{k}_{1}+1}\cdots {P}_{{k}_{2}-1}$.
Constraint: ${\mathbf{direct}}=\text{'F'}$ or $\text{'B'}$.
4:     $\mathbf{m}$ – IntegerInput
On entry: $m$, the number of rows of the matrix $A$.
If ${\mathbf{m}}<1$, an immediate return is effected.
Constraint: ${\mathbf{m}}\ge 0$.
5:     $\mathbf{n}$ – IntegerInput
On entry: $n$, the number of columns of the matrix $A$.
If ${\mathbf{n}}<1$, an immediate return is effected.
Constraint: ${\mathbf{n}}\ge 0$.
6:     $\mathbf{k1}$ – IntegerInput
7:     $\mathbf{k2}$ – IntegerInput
On entry: the values ${k}_{1}$ and ${k}_{2}$.
If ${\mathbf{k1}}<1$ or ${\mathbf{k2}}\le {\mathbf{k1}}$, or ${\mathbf{side}}=\text{'L'}$ and ${\mathbf{k2}}>{\mathbf{m}}$, or ${\mathbf{side}}=\text{'R'}$ and ${\mathbf{k2}}>{\mathbf{n}}$, an immediate return is effected.
8:     $\mathbf{c}\left({\mathbf{k2}}-1\right)$ – Real (Kind=nag_wp) arrayInput
On entry: ${\mathbf{c}}\left(\mathit{k}\right)$ must hold ${c}_{\mathit{k}}$, the cosine of the rotation ${P}_{\mathit{k}}$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$.
9:     $\mathbf{s}\left({\mathbf{k2}}-1\right)$ – Real (Kind=nag_wp) arrayInput
On entry: ${\mathbf{s}}\left(\mathit{k}\right)$ must hold ${s}_{\mathit{k}}$, the sine of the rotation ${P}_{\mathit{k}}$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$.
10:   $\mathbf{a}\left({\mathbf{lda}},*\right)$ – Real (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array a must be at least ${\mathbf{n}}$.
On entry: the $m$ by $n$ matrix $A$.
On exit: the transformed matrix $A$.
11:   $\mathbf{lda}$ – IntegerInput
On entry: the first dimension of the array a as declared in the (sub)program from which f06qxf is called.
Constraint: ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$.

None.

Not applicable.

## 8Parallelism and Performance

f06qxf is not threaded in any implementation.