# NAG FL Interfacef08bcf (dtpmqrt)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

f08bcf multiplies an arbitrary real matrix $C$ by the real orthogonal matrix $Q$ from a $QR$ factorization computed by f08bbf.

## 2Specification

Fortran Interface
 Subroutine f08bcf ( side, m, n, k, l, nb, v, ldv, t, ldt, c1, ldc1, c2, ldc2, work, info)
 Integer, Intent (In) :: m, n, k, l, nb, ldv, ldt, ldc1, ldc2 Integer, Intent (Out) :: info Real (Kind=nag_wp), Intent (In) :: v(ldv,*), t(ldt,*) Real (Kind=nag_wp), Intent (Inout) :: c1(ldc1,*), c2(ldc2,*), work(*) Character (1), Intent (In) :: side, trans
#include <nag.h>
 void f08bcf_ (const char *side, const char *trans, const Integer *m, const Integer *n, const Integer *k, const Integer *l, const Integer *nb, const double v[], const Integer *ldv, const double t[], const Integer *ldt, double c1[], const Integer *ldc1, double c2[], const Integer *ldc2, double work[], Integer *info, const Charlen length_side, const Charlen length_trans)
The routine may be called by the names f08bcf, nagf_lapackeig_dtpmqrt or its LAPACK name dtpmqrt.

## 3Description

f08bcf is intended to be used after a call to f08bbf which performs a $QR$ factorization of a triangular-pentagonal matrix containing an upper triangular matrix $A$ over a pentagonal matrix $B$. The orthogonal matrix $Q$ is represented as a product of elementary reflectors.
This routine may be used to form the matrix products
 $QC , QTC , CQ ​ or ​ CQT ,$
where the real rectangular ${m}_{c}×{n}_{c}$ matrix $C$ is split into component matrices ${C}_{1}$ and ${C}_{2}$.
If $Q$ is being applied from the left ($QC$ or ${Q}^{\mathrm{T}}C$) then
 $C = ( C1 C2 )$
where ${C}_{1}$ is $k×{n}_{c}$, ${C}_{2}$ is ${m}_{v}×{n}_{c}$, ${m}_{c}=k+{m}_{v}$ is fixed and ${m}_{v}$ is the number of rows of the matrix $V$ containing the elementary reflectors (i.e., m as passed to f08bbf); the number of columns of $V$ is ${n}_{v}$ (i.e., n as passed to f08bbf).
If $Q$ is being applied from the right ($CQ$ or $C{Q}^{\mathrm{T}}$) then
 $C = ( C1 C2 )$
where ${C}_{1}$ is ${m}_{c}×k$, and ${C}_{2}$ is ${m}_{c}×{m}_{v}$ and ${n}_{c}=k+{m}_{v}$ is fixed.
The matrices ${C}_{1}$ and ${C}_{2}$ are overwriten by the result of the matrix product.
A common application of this routine is in updating the solution of a linear least squares problem as illustrated in Section 10 in f08bbf.

## 4References

Golub G H and Van Loan C F (2012) Matrix Computations (4th Edition) Johns Hopkins University Press, Baltimore

## 5Arguments

1: $\mathbf{side}$Character(1) Input
On entry: indicates how $Q$ or ${Q}^{\mathrm{T}}$ is to be applied to $C$.
${\mathbf{side}}=\text{'L'}$
$Q$ or ${Q}^{\mathrm{T}}$ is applied to $C$ from the left.
${\mathbf{side}}=\text{'R'}$
$Q$ or ${Q}^{\mathrm{T}}$ is applied to $C$ from the right.
Constraint: ${\mathbf{side}}=\text{'L'}$ or $\text{'R'}$.
2: $\mathbf{trans}$Character(1) Input
On entry: indicates whether $Q$ or ${Q}^{\mathrm{T}}$ is to be applied to $C$.
${\mathbf{trans}}=\text{'N'}$
$Q$ is applied to $C$.
${\mathbf{trans}}=\text{'T'}$
${Q}^{\mathrm{T}}$ is applied to $C$.
Constraint: ${\mathbf{trans}}=\text{'N'}$ or $\text{'T'}$.
3: $\mathbf{m}$Integer Input
On entry: the number of rows of the matrix ${C}_{2}$, that is,
if ${\mathbf{side}}=\text{'L'}$
then ${m}_{v}$, the number of rows of the matrix $V$;
if ${\mathbf{side}}=\text{'R'}$
then ${m}_{c}$, the number of rows of the matrix $C$.
Constraint: ${\mathbf{m}}\ge 0$.
4: $\mathbf{n}$Integer Input
On entry: the number of columns of the matrix ${C}_{2}$, that is,
if ${\mathbf{side}}=\text{'L'}$
then ${n}_{c}$, the number of columns of the matrix $C$;
if ${\mathbf{side}}=\text{'R'}$
then ${n}_{v}$, the number of columns of the matrix $V$.
Constraint: ${\mathbf{n}}\ge 0$.
5: $\mathbf{k}$Integer Input
On entry: $k$, the number of elementary reflectors whose product defines the matrix $Q$.
Constraint: ${\mathbf{k}}\ge 0$.
6: $\mathbf{l}$Integer Input
On entry: $l$, the number of rows of the upper trapezoidal part of the pentagonal composite matrix $V$, passed (as b) in a previous call to f08bbf. This must be the same value used in the previous call to f08bbf (see l in f08bbf).
Constraint: $0\le {\mathbf{l}}\le {\mathbf{k}}$.
7: $\mathbf{nb}$Integer Input
On entry: $\mathit{nb}$, the blocking factor used in a previous call to f08bbf to compute the $QR$ factorization of a triangular-pentagonal matrix containing composite matrices $A$ and $B$.
Constraints:
• ${\mathbf{nb}}\ge 1$;
• if ${\mathbf{k}}>0$, ${\mathbf{nb}}\le {\mathbf{k}}$.
8: $\mathbf{v}\left({\mathbf{ldv}},*\right)$Real (Kind=nag_wp) array Input
Note: the second dimension of the array v must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{k}}\right)$.
On entry: the ${m}_{v}×{n}_{v}$ matrix $V$; this should remain unchanged from the array b returned by a previous call to f08bbf.
9: $\mathbf{ldv}$Integer Input
On entry: the first dimension of the array v as declared in the (sub)program from which f08bcf is called.
Constraints:
• if ${\mathbf{side}}=\text{'L'}$, ${\mathbf{ldv}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$;
• if ${\mathbf{side}}=\text{'R'}$, ${\mathbf{ldv}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
10: $\mathbf{t}\left({\mathbf{ldt}},*\right)$Real (Kind=nag_wp) array Input
Note: the second dimension of the array t must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{k}}\right)$.
On entry: this must remain unchanged from a previous call to f08bbf (see t in f08bbf).
11: $\mathbf{ldt}$Integer Input
On entry: the first dimension of the array t as declared in the (sub)program from which f08bcf is called.
Constraint: ${\mathbf{ldt}}\ge {\mathbf{nb}}$.
12: $\mathbf{c1}\left({\mathbf{ldc1}},*\right)$Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array c1 must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$ if ${\mathbf{side}}=\text{'L'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{k}}\right)$ if ${\mathbf{side}}=\text{'R'}$.
On entry: ${C}_{1}$, the first part of the composite matrix $C$:
if ${\mathbf{side}}=\text{'L'}$
then c1 contains the first $k$ rows of $C$;
if ${\mathbf{side}}=\text{'R'}$
then c1 contains the first $k$ columns of $C$.
On exit: c1 is overwritten by the corresponding block of $QC$ or ${Q}^{\mathrm{T}}C$ or $CQ$ or $C{Q}^{\mathrm{T}}$.
13: $\mathbf{ldc1}$Integer Input
On entry: the first dimension of the array c1 as declared in the (sub)program from which f08bcf is called.
Constraints:
• if ${\mathbf{side}}=\text{'L'}$, ${\mathbf{ldc1}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{k}}\right)$;
• if ${\mathbf{side}}=\text{'R'}$, ${\mathbf{ldc1}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$.
14: $\mathbf{c2}\left({\mathbf{ldc2}},*\right)$Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array c2 must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: ${C}_{2}$, the second part of the composite matrix $C$.
if ${\mathbf{side}}=\text{'L'}$
then c2 contains the remaining ${m}_{v}$ rows of $C$;
if ${\mathbf{side}}=\text{'R'}$
then c2 contains the remaining ${m}_{v}$ columns of $C$;
On exit: c2 is overwritten by the corresponding block of $QC$ or ${Q}^{\mathrm{T}}C$ or $CQ$ or $C{Q}^{\mathrm{T}}$.
15: $\mathbf{ldc2}$Integer Input
On entry: the first dimension of the array c2 as declared in the (sub)program from which f08bcf is called.
Constraint: ${\mathbf{ldc2}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$.
16: $\mathbf{work}\left(*\right)$Real (Kind=nag_wp) array Workspace
Note: the dimension of the array work must be at least ${\mathbf{n}}×{\mathbf{nb}}$ if ${\mathbf{side}}=\text{'L'}$ and at least ${\mathbf{m}}×{\mathbf{nb}}$ if ${\mathbf{side}}=\text{'R'}$.
17: $\mathbf{info}$Integer Output
On exit: ${\mathbf{info}}=0$ unless the routine detects an error (see Section 6).

## 6Error Indicators and Warnings

${\mathbf{info}}<0$
If ${\mathbf{info}}=-i$, argument $i$ had an illegal value. An explanatory message is output, and execution of the program is terminated.

## 7Accuracy

The computed result differs from the exact result by a matrix $E$ such that
 $‖E‖2 = O(ε) ‖C‖2 ,$
where $\epsilon$ is the machine precision.

## 8Parallelism and Performance

The total number of floating-point operations is approximately $2nk\left(2m-k\right)$ if ${\mathbf{side}}=\text{'L'}$ and $2mk\left(2n-k\right)$ if ${\mathbf{side}}=\text{'R'}$.