F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

NAG Library Routine DocumentF06TPF

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

F06TPF performs a $QR$ factorization (as a sequence of plane rotations) of a complex upper triangular matrix that has been modified by a rank-1 update.

2  Specification

 SUBROUTINE F06TPF ( N, ALPHA, X, INCX, Y, INCY, A, LDA, C, S)
 INTEGER N, INCX, INCY, LDA REAL (KIND=nag_wp) C(N-1) COMPLEX (KIND=nag_wp) ALPHA, X(*), Y(*), A(LDA,*), S(N)

3  Description

F06TPF performs a $QR$ factorization of an upper triangular matrix which has been modified by a rank-1 update:
 $αxyT + U=QR$
where $U$ and $R$ are $n$ by $n$ complex upper triangular matrices with real diagonal elements, $x$ and $y$ are $n$-element complex vectors, $\alpha$ is a complex scalar, and $Q$ is an $n$ by $n$ complex unitary matrix.
$Q$ is formed as the product of two sequences of plane rotations and a unitary diagonal matrix $D$:
 $QH = DQn-1 ⋯ Q2 Q1 P1 P2 ⋯ Pn-1$
where
• ${P}_{k}$ is a rotation in the $\left(k,n\right)$ plane, chosen to annihilate ${x}_{k}$: thus $Px=\beta {e}_{n}$, where $P={P}_{1}{P}_{2}\cdots {P}_{n-1}$ and ${e}_{n}$ is the last column of the unit matrix;
• ${Q}_{k}$ is a rotation in the $\left(k,n\right)$ plane, chosen to annihilate the $\left(n,k\right)$ element of $\left(\alpha \beta {e}_{n}{y}^{\mathrm{T}}+PU\right)$, and thus restore it to upper triangular form;
• $D=\mathrm{diag}\left(1,\dots ,1,{d}_{n}\right)$, with ${d}_{n}$ chosen to make ${r}_{nn}$ real; $\left|{d}_{n}\right|=1$.
The $2$ by $2$ plane rotation part of ${P}_{k}$ or ${Q}_{k}$ has the form
 $ck s-k -sk ck$
with ${c}_{k}$ real. The tangents of the rotations ${P}_{k}$ are returned in the array X; the cosines and sines of these rotations can be recovered by calling F06BCF. The cosines and sines of the rotations ${Q}_{k}$ are returned directly in the arrays C and S.

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:     Y($*$) – COMPLEX (KIND=nag_wp) arrayInput
Note: the dimension of the array Y must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{N}}-1\right)×{\mathbf{INCY}}\right)$.
On entry: the $n$-element vector $y$. ${y}_{\mathit{i}}$ must be stored in ${\mathbf{Y}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{INCY}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
Intermediate elements of Y are not referenced.
6:     INCY – INTEGERInput
On entry: the increment in the subscripts of Y between successive elements of $y$.
Constraint: ${\mathbf{INCY}}>0$.
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$. The imaginary parts of the diagonal elements must be zero.
On exit: the upper triangular matrix $R$. The imaginary parts of the diagonal elements must be zero.
8:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F06TPF is called.
Constraint: ${\mathbf{LDA}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
9:     C(${\mathbf{N}}-1$) – REAL (KIND=nag_wp) arrayOutput
On exit: the cosines of the rotations ${Q}_{\mathit{k}}$, for $\mathit{k}=1,2,\dots ,n-1$.
10:   S(N) – COMPLEX (KIND=nag_wp) arrayOutput
On exit: the sines of the rotations ${Q}_{\mathit{k}}$, for $\mathit{k}=1,2,\dots ,n-1$; ${\mathbf{S}}\left(n\right)$ holds ${d}_{n}$, the $n$th diagonal element of $D$.

None.

Not applicable.