# NAG FL Interfacef07vsf (ztbtrs)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

f07vsf solves a complex triangular band system of linear equations with multiple right-hand sides, $AX=B$, ${A}^{\mathrm{T}}X=B$ or ${A}^{\mathrm{H}}X=B$.

## 2Specification

Fortran Interface
 Subroutine f07vsf ( uplo, diag, n, kd, nrhs, ab, ldab, b, ldb, info)
 Integer, Intent (In) :: n, kd, nrhs, ldab, ldb Integer, Intent (Out) :: info Complex (Kind=nag_wp), Intent (In) :: ab(ldab,*) Complex (Kind=nag_wp), Intent (Inout) :: b(ldb,*) Character (1), Intent (In) :: uplo, trans, diag
#include <nag.h>
 void f07vsf_ (const char *uplo, const char *trans, const char *diag, const Integer *n, const Integer *kd, const Integer *nrhs, const Complex ab[], const Integer *ldab, Complex b[], const Integer *ldb, Integer *info, const Charlen length_uplo, const Charlen length_trans, const Charlen length_diag)
The routine may be called by the names f07vsf, nagf_lapacklin_ztbtrs or its LAPACK name ztbtrs.

## 3Description

f07vsf solves a complex triangular band system of linear equations $AX=B$, ${A}^{\mathrm{T}}X=B$ or ${A}^{\mathrm{H}}X=B$.

## 4References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Higham N J (1989) The accuracy of solutions to triangular systems SIAM J. Numer. Anal. 26 1252–1265

## 5Arguments

1: $\mathbf{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'}$.
2: $\mathbf{trans}$Character(1) Input
On entry: indicates the form of the equations.
${\mathbf{trans}}=\text{'N'}$
The equations are of the form $AX=B$.
${\mathbf{trans}}=\text{'T'}$
The equations are of the form ${A}^{\mathrm{T}}X=B$.
${\mathbf{trans}}=\text{'C'}$
The equations are of the form ${A}^{\mathrm{H}}X=B$.
Constraint: ${\mathbf{trans}}=\text{'N'}$, $\text{'T'}$ or $\text{'C'}$.
3: $\mathbf{diag}$Character(1) Input
On entry: indicates whether $A$ is a nonunit or unit triangular matrix.
${\mathbf{diag}}=\text{'N'}$
$A$ is a nonunit triangular matrix.
${\mathbf{diag}}=\text{'U'}$
$A$ is a unit triangular matrix; the diagonal elements are not referenced and are assumed to be $1$.
Constraint: ${\mathbf{diag}}=\text{'N'}$ or $\text{'U'}$.
4: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
5: $\mathbf{kd}$Integer Input
On entry: ${k}_{d}$, the number of superdiagonals of the matrix $A$ if ${\mathbf{uplo}}=\text{'U'}$, or the number of subdiagonals if ${\mathbf{uplo}}=\text{'L'}$.
Constraint: ${\mathbf{kd}}\ge 0$.
6: $\mathbf{nrhs}$Integer Input
On entry: $r$, the number of right-hand sides.
Constraint: ${\mathbf{nrhs}}\ge 0$.
7: $\mathbf{ab}\left({\mathbf{ldab}},*\right)$Complex (Kind=nag_wp) array Input
Note: the second dimension of the array ab must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the $n×n$ triangular band matrix $A$.
The matrix is stored in rows $1$ to ${k}_{d}+1$, more precisely,
• if ${\mathbf{uplo}}=\text{'U'}$, the elements of the upper triangle of $A$ within the band must be stored with element ${A}_{ij}$ in ${\mathbf{ab}}\left({k}_{d}+1+i-j,j\right)\text{​ for ​}\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,j-{k}_{d}\right)\le i\le j$;
• if ${\mathbf{uplo}}=\text{'L'}$, the elements of the lower triangle of $A$ within the band must be stored with element ${A}_{ij}$ in ${\mathbf{ab}}\left(1+i-j,j\right)\text{​ for ​}j\le i\le \mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(n,j+{k}_{d}\right)\text{.}$
If ${\mathbf{diag}}=\text{'U'}$, the diagonal elements of $A$ are assumed to be $1$, and are not referenced.
8: $\mathbf{ldab}$Integer Input
On entry: the first dimension of the array ab as declared in the (sub)program from which f07vsf is called.
Constraint: ${\mathbf{ldab}}\ge {\mathbf{kd}}+1$.
9: $\mathbf{b}\left({\mathbf{ldb}},*\right)$Complex (Kind=nag_wp) array Input/Output
Note: the second dimension of the array b must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{nrhs}}\right)$.
On entry: the $n×r$ right-hand side matrix $B$.
On exit: the $n×r$ solution matrix $X$.
10: $\mathbf{ldb}$Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f07vsf is called.
Constraint: ${\mathbf{ldb}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
11: $\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.
${\mathbf{info}}>0$
Element $⟨\mathit{\text{value}}⟩$ of the diagonal is exactly zero. $A$ is singular and the solution has not been computed.

## 7Accuracy

The solutions of triangular systems of equations are usually computed to high accuracy. See Higham (1989).
For each right-hand side vector $b$, the computed solution $x$ is the exact solution of a perturbed system of equations $\left(A+E\right)x=b$, where
 $|E|≤c(k)ε|A| ,$
$c\left(k\right)$ is a modest linear function of $k$, and $\epsilon$ is the machine precision.
If $\stackrel{^}{x}$ is the true solution, then the computed solution $x$ satisfies a forward error bound of the form
 $‖x-x^‖∞ ‖x‖∞ ≤c(k)cond(A,x)ε , provided c(k)cond(A,x)ε<1 ,$
where $\mathrm{cond}\left(A,x\right)={‖|{A}^{-1}||A||x|‖}_{\infty }/{‖x‖}_{\infty }$.
Note that $\mathrm{cond}\left(A,x\right)\le \mathrm{cond}\left(A\right)={‖|{A}^{-1}||A|‖}_{\infty }\le {\kappa }_{\infty }\left(A\right)$; $\mathrm{cond}\left(A,x\right)$ can be much smaller than $\mathrm{cond}\left(A\right)$ and it is also possible for $\mathrm{cond}\left({A}^{\mathrm{H}}\right)$, which is the same as $\mathrm{cond}\left({A}^{\mathrm{T}}\right)$, to be much larger (or smaller) than $\mathrm{cond}\left(A\right)$.
Forward and backward error bounds can be computed by calling f07vvf, and an estimate for ${\kappa }_{\infty }\left(A\right)$ can be obtained by calling f07vuf with ${\mathbf{norm}}=\text{'I'}$.

## 8Parallelism and Performance

f07vsf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f07vsf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

The total number of real floating-point operations is approximately $8nkr$ if $k\ll n$.
The real analogue of this routine is f07vef.

## 10Example

This example solves the system of equations $AX=B$, where
 $A= ( -1.94+4.43i 0.00+0.00i 0.00+0.00i 0.00+0.00i -3.39+3.44i 4.12-4.27i 0.00+0.00i 0.00+0.00i 1.62+3.68i -1.84+5.53i 0.43-2.66i 0.00+0.00i 0.00+0.00i -2.77-1.93i 1.74-0.04i 0.44+0.10i )$
and
 $B= ( -8.86-03.88i -24.09-05.27i -15.57-23.41i -57.97+08.14i -7.63+22.78i 19.09-29.51i -14.74-02.40i 19.17+21.33i ) .$
Here $A$ is treated as a lower triangular band matrix with two subdiagonals.

### 10.1Program Text

Program Text (f07vsfe.f90)

### 10.2Program Data

Program Data (f07vsfe.d)

### 10.3Program Results

Program Results (f07vsfe.r)