F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06WPF (ZTFSM)

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

F06WPF (ZTFSM) performs one of the matrix-matrix operations
 $B←αA-1B , B←αA-HB , B←αBA-1 or B←αBA-H ,$
where $A$ is a complex triangular matrix stored in Rectangular Full Packed (RFP) format, $B$ is an $m$ by $n$ complex matrix, and $\alpha$ is a complex scalar. ${A}^{-\mathrm{H}}$ denotes ${\left({A}^{\mathrm{H}}\right)}^{-1}$ or equivalently ${\left({A}^{-1}\right)}^{\mathrm{H}}$. The RFP storage format is described in Section 3.3.3 in the F07 Chapter Introduction.
No test for singularity or near-singularity of $A$ is included in this routine. Such tests must be performed before calling this routine.

## 2  Specification

 SUBROUTINE F06WPF ( TRANSR, SIDE, UPLO, TRANS, DIAG, M, N, ALPHA, A, B, LDB)
 INTEGER M, N, LDB COMPLEX (KIND=nag_wp) ALPHA, A(*), B(LDB,*) CHARACTER(1) TRANSR, SIDE, UPLO, TRANS, DIAG
The routine may be called by its LAPACK name ztfsm.

## 3  Description

F06WPF (ZTFSM) solves (for $X$) a triangular linear system of one of the forms
 $AX=αB , AHX=αB , XA=αB or XAH=αB ,$
where $A$ is a complex triangular matrix stored in RFP format, $B$, $X$ are $m$ by $n$ complex matrices, and $\alpha$ is a complex scalar.

None.

## 5  Parameters

1:     TRANSR – CHARACTER(1)Input
On entry: specifies whether the normal RFP representation of $A$ or its conjugate transpose is stored.
${\mathbf{TRANSR}}=\text{'N'}$
The matrix $A$ is stored in normal RFP format.
${\mathbf{TRANSR}}=\text{'C'}$
The conjugate transpose of the RFP representation of the matrix $A$ is stored.
Constraint: ${\mathbf{TRANSR}}=\text{'N'}$ or $\text{'C'}$.
2:     SIDE – CHARACTER(1)Input
On entry: specifies whether $B$ is operated on from the left or the right, or similarly whether $A$ (or its transpose) appears to the left or right of the solution matrix in the linear system to be solved.
${\mathbf{SIDE}}=\text{'L'}$
$B$ is pre-multiplied from the left. The system to be solved has the form $AX=\alpha B$ or ${A}^{\mathrm{H}}X=\alpha B$.
${\mathbf{SIDE}}=\text{'R'}$
$B$ is post-multiplied from the right. The system to be solved has the form $XA=\alpha B$ or $X{A}^{\mathrm{H}}=\alpha B$.
Constraint: ${\mathbf{SIDE}}=\text{'L'}$ or $\text{'R'}$.
3:     UPLO – CHARACTER(1)Input
On entry: specifies whether $A$ is upper or lower triangular.
${\mathbf{UPLO}}=\text{'U'}$
$A$ is upper triangular.
${\mathbf{UPLO}}=\text{'L'}$
$A$ is lower triangular.
Constraint: ${\mathbf{UPLO}}=\text{'U'}$ or $\text{'L'}$.
4:     TRANS – CHARACTER(1)Input
On entry: specifies whether the operation involves ${A}^{-1}$ or ${A}^{-\mathrm{H}}$, i.e., whether or not $A$ is transpose conjugated in the linear system to be solved.
${\mathbf{TRANS}}=\text{'N'}$
The operation involves ${A}^{-1}$, i.e., $A$ is not transpose conjugated.
${\mathbf{TRANS}}=\text{'C'}$
The operation involves ${A}^{-\mathrm{H}}$, i.e., $A$ is transpose conjugated.
Constraint: ${\mathbf{TRANS}}=\text{'N'}$ or $\text{'C'}$.
5:     DIAG – CHARACTER(1)Input
On entry: specifies whether $A$ has nonunit or unit diagonal elements.
${\mathbf{DIAG}}=\text{'N'}$
The diagonal elements of $A$ are stored explicitly.
${\mathbf{DIAG}}=\text{'U'}$
The diagonal elements of $A$ are assumed to be $1$, the corresponding elements of A are not referenced.
Constraint: ${\mathbf{DIAG}}=\text{'N'}$ or $\text{'U'}$.
6:     M – INTEGERInput
On entry: $m$, the number of rows of the matrix $B$.
Constraint: ${\mathbf{M}}\ge 0$.
7:     N – INTEGERInput
On entry: $n$, the number of columns of the matrix $B$.
Constraint: ${\mathbf{N}}\ge 0$.
8:     ALPHA – COMPLEX (KIND=nag_wp)Input
On entry: the scalar $\alpha$.
9:     A($*$) – COMPLEX (KIND=nag_wp) arrayInput
Note: the dimension of the array A must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{M}}×\left({\mathbf{M}}+1\right)/2\right)$ if ${\mathbf{SIDE}}=\text{'L'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}×\left({\mathbf{N}}+1\right)/2\right)$ if ${\mathbf{SIDE}}=\text{'R'}$.
On entry: $A$, the $m$ by $m$ triangular matrix $A$ if ${\mathbf{SIDE}}=\text{'L'}$ or the $n$ by $n$ triangular matrix $A$ if ${\mathbf{SIDE}}=\text{'R'}$, stored in RFP format, as described in Section 3.3.3 in the F07 Chapter Introduction.
10:   B(LDB,$*$) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array B must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
On entry: the $m$ by $n$ matrix $B$.
If ${\mathbf{ALPHA}}=0$, B need not be set.
On exit: the updated matrix $B$, or similarly the solution matrix $X$.
11:   LDB – INTEGERInput
On entry: the first dimension of the array B as declared in the (sub)program from which F06WPF (ZTFSM) is called.
Constraint: ${\mathbf{LDB}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{M}}\right)$.

None.

Not applicable.

None.

## 9  Example

This example reads in the upper triangular part of a symmetric matrix $A$ which it converts to RFP format. It also reads in $\alpha$ and a $4$ by $3$ matrix $B$ and then performs the matrix-matrix operation $B←\alpha {A}^{-1}B$.

### 9.1  Program Text

Program Text (f06wpfe.f90)

### 9.2  Program Data

Program Data (f06wpfe.d)

### 9.3  Program Results

Program Results (f06wpfe.r)