F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06TTF

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

F06TTF performs a $QR$ or $RQ$ factorization of the product of a complex upper triangular matrix and a complex matrix of plane rotations.

## 2  Specification

 SUBROUTINE F06TTF ( SIDE, N, K1, K2, C, S, A, LDA)
 INTEGER N, K1, K2, LDA REAL (KIND=nag_wp) C(*) COMPLEX (KIND=nag_wp) S(*), A(LDA,*) CHARACTER(1) SIDE

## 3  Description

F06TTF performs one of the transformations
 $R←PUQH or R←QUPH ,$
where $U$ is a given $n$ by $n$ complex upper triangular matrix, $P$ is a given complex unitary matrix, and $Q$ is a complex unitary matrix chosen to make $R$ upper triangular. Both $P$ and $Q$ are represented as sequences of plane rotations in planes ${k}_{1}$ to ${k}_{2}$.
If ${\mathbf{SIDE}}=\text{'L'}$,
 $R←PUQH ,$
where $P={P}_{{k}_{2}-1}\dots {P}_{{k}_{1}+1}{P}_{{k}_{1}}$ and $Q={Q}_{{k}_{2}-1}\dots {Q}_{{k}_{1}+1}{Q}_{{k}_{1}}$.
If ${\mathbf{SIDE}}=\text{'R'}$,
 $R←QUPH ,$
where $P={P}_{{k}_{1}}{P}_{{k}_{1}+1}\dots {P}_{{k}_{2}-1}$ and $Q={Q}_{{k}_{1}}{Q}_{{k}_{1}+1}\dots {Q}_{{k}_{2}-1}$.
In either case ${P}_{k}$ and ${Q}_{k}$ are rotations in the $\left(k,k+1\right)$ plane.
The $2$ by $2$ rotation part of ${P}_{k}$ or ${Q}_{k}$ has the form
 $ck s-k -sk ck$
with ${c}_{k}$ real.
None.

## 5  Parameters

1:     SIDE – CHARACTER(1)Input
On entry: specifies whether $P$ is applied from the left or the right in the transformation.
${\mathbf{SIDE}}=\text{'L'}$
$P$ is applied from the left.
${\mathbf{SIDE}}=\text{'R'}$
$P$ is applied from the right.
Constraint: ${\mathbf{SIDE}}=\text{'L'}$ or $\text{'R'}$.
2:     N – INTEGERInput
On entry: $n$, the order of the matrices $U$ and $R$.
Constraint: ${\mathbf{N}}\ge 0$.
3:     K1 – INTEGERInput
4:     K2 – INTEGERInput
On entry: the values ${k}_{1}$ and ${k}_{2}$.
If ${\mathbf{K1}}<1$ or ${\mathbf{K2}}\le {\mathbf{K1}}$ or ${\mathbf{K2}}>{\mathbf{N}}$, an immediate return is effected.
5:     C($*$) – REAL (KIND=nag_wp) arrayInput/Output
Note: the dimension of the array C must be at least ${\mathbf{K2}}-{\mathbf{K1}}$.
On entry: ${\mathbf{C}}\left(\mathit{k}\right)$ must hold the cosine of the rotation ${P}_{\mathit{k}}$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$.
On exit: ${\mathbf{C}}\left(\mathit{k}\right)$ holds the cosine of the rotation ${Q}_{\mathit{k}}$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$.
6:     S($*$) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the dimension of the array S must be at least ${\mathbf{K2}}-{\mathbf{K1}}$.
On entry: ${\mathbf{S}}\left(\mathit{k}\right)$ must hold the sine of the rotation ${P}_{\mathit{k}}$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$.
On exit: ${\mathbf{S}}\left(\mathit{k}\right)$ holds the sine of the rotation ${Q}_{\mathit{k}}$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$.
7:     A(LDA,$*$) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array A must be at least ${\mathbf{N}}$.
On entry: the $n$ by $n$ upper triangular matrix $U$.
On exit: the upper triangular matrix $R$.
8:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F06TTF is called.
Constraint: ${\mathbf{LDA}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.

None.

Not applicable.