F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06TQF

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

F06TQF performs a $QR$ factorization (as a sequence of plane rotations) of a complex upper triangular matrix that has been augmented by a full row.

## 2  Specification

 SUBROUTINE F06TQF ( N, ALPHA, X, INCX, A, LDA, C, S)
 INTEGER N, INCX, LDA REAL (KIND=nag_wp) C(N) COMPLEX (KIND=nag_wp) ALPHA, X(*), A(LDA,*), S(N)

## 3  Description

F06TQF performs the factorization
 $U αxT =Q R 0$
where $U$ and $R$ are $n$ by $n$ complex upper triangular matrices, $x$ is an $n$-element complex vector, $\alpha$ is a complex scalar, and $Q$ is a complex unitary matrix. If $U$ has real diagonal elements, then so does $R$.
$Q$ is formed as a sequence of plane rotations
 $QH = Qn ⋯ Q2 Q1$
where ${Q}_{k}$ is a rotation in the $\left(k,n+1\right)$ plane, chosen to annihilate ${x}_{k}$.
The $2$ by $2$ plane rotation part of ${Q}_{k}$ has the form
 $ck s-k -sk ck$
with ${c}_{k}$ real.

None.

## 5  Parameters

1:     N – INTEGERInput
On entry: $n$, the order of the matrices $U$ and $R$.
Constraint: ${\mathbf{N}}\ge 0$.
2:     ALPHA – COMPLEX (KIND=nag_wp)Input
On entry: the scalar $\alpha$.
3:     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 sequence of plane rotations.
4:     INCX – INTEGERInput
On entry: the increment in the subscripts of X between successive elements of $x$.
Constraint: ${\mathbf{INCX}}>0$.
5:     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$.
6:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F06TQF is called.
Constraint: ${\mathbf{LDA}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
7:     C(N) – REAL (KIND=nag_wp) arrayOutput
On exit: the values ${c}_{\mathit{k}}$, the cosines of the rotations ${Q}_{\mathit{k}}$, for $\mathit{k}=1,2,\dots ,n$.
8:     S(N) – COMPLEX (KIND=nag_wp) arrayOutput
On exit: the values ${s}_{\mathit{k}}$, the sines of the rotations ${Q}_{\mathit{k}}$, for $\mathit{k}=1,2,\dots ,n$.

None.

Not applicable.