F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06QQF

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

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

## 2  Specification

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

## 3  Description

F06QQF performs the factorization
 $U αxT =Q R 0$
where $U$ and $R$ are $n$ by $n$ real upper triangular matrices, $x$ is an $n$-element real vector, $\alpha$ is a real scalar, and $Q$ is a real orthogonal matrix.
$Q$ is formed as a sequence of plane rotations
 $QT = 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 sk -sk ck .$

None.

## 5  Parameters

1:     N – INTEGERInput
On entry: $n$, the order of the matrices $U$ and $R$.
Constraint: ${\mathbf{N}}\ge 0$.
2:     ALPHA – REAL (KIND=nag_wp)Input
On entry: the scalar $\alpha$.
3:     X($*$) – 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 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}}$.
On exit: the referenced elements are overwritten by the tangents of the rotations ${Q}_{\mathit{k}}$, for $\mathit{k}=1,2,\dots ,n$.
4:     INCX – INTEGERInput
On entry: the increment in the subscripts of X between successive elements of $x$.
Constraint: ${\mathbf{INCX}}>0$.
5:     A(LDA,$*$) – REAL (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 F06QQF 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) – REAL (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.

None.

None.