F07 Chapter Contents
F07 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF07VEF (DTBTRS)

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

F07VEF (DTBTRS) solves a real triangular band system of linear equations with multiple right-hand sides, $AX=B$ or ${A}^{\mathrm{T}}X=B$.

## 2  Specification

 SUBROUTINE F07VEF ( UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, B, LDB, INFO)
 INTEGER N, KD, NRHS, LDAB, LDB, INFO REAL (KIND=nag_wp) AB(LDAB,*), B(LDB,*) CHARACTER(1) UPLO, TRANS, DIAG
The routine may be called by its LAPACK name dtbtrs.

## 3  Description

F07VEF (DTBTRS) solves a real triangular band system of linear equations $AX=B$ or ${A}^{\mathrm{T}}X=B$.

## 4  References

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

## 5  Parameters

1:     $\mathrm{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:     $\mathrm{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'}$ or $\text{'C'}$
The equations are of the form ${A}^{\mathrm{T}}X=B$.
Constraint: ${\mathbf{TRANS}}=\text{'N'}$, $\text{'T'}$ or $\text{'C'}$.
3:     $\mathrm{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:     $\mathrm{N}$ – INTEGERInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{N}}\ge 0$.
5:     $\mathrm{KD}$ – INTEGERInput
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:     $\mathrm{NRHS}$ – INTEGERInput
On entry: $r$, the number of right-hand sides.
Constraint: ${\mathbf{NRHS}}\ge 0$.
7:     $\mathrm{AB}\left({\mathbf{LDAB}},*\right)$ – REAL (KIND=nag_wp) arrayInput
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$ by $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:     $\mathrm{LDAB}$ – INTEGERInput
On entry: the first dimension of the array AB as declared in the (sub)program from which F07VEF (DTBTRS) is called.
Constraint: ${\mathbf{LDAB}}\ge {\mathbf{KD}}+1$.
9:     $\mathrm{B}\left({\mathbf{LDB}},*\right)$ – REAL (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{NRHS}}\right)$.
On entry: the $n$ by $r$ right-hand side matrix $B$.
On exit: the $n$ by $r$ solution matrix $X$.
10:   $\mathrm{LDB}$ – INTEGERInput
On entry: the first dimension of the array B as declared in the (sub)program from which F07VEF (DTBTRS) is called.
Constraint: ${\mathbf{LDB}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
11:   $\mathrm{INFO}$ – INTEGEROutput
On exit: ${\mathbf{INFO}}=0$ unless the routine detects an error (see Section 6).

## 6  Error 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.

## 7  Accuracy

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≤ckε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∞ ≤ckcondA,xε , provided ckcondA,xε<1 ,$
where $\mathrm{cond}\left(A,x\right)={‖\left|{A}^{-1}\right|\left|A\right|\left|x\right|‖}_{\infty }/{‖x‖}_{\infty }$.
Note that $\mathrm{cond}\left(A,x\right)\le \mathrm{cond}\left(A\right)={‖\left|{A}^{-1}\right|\left|A\right|‖}_{\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{T}}\right)$ to be much larger (or smaller) than $\mathrm{cond}\left(A\right)$.
Forward and backward error bounds can be computed by calling F07VHF (DTBRFS), and an estimate for ${\kappa }_{\infty }\left(A\right)$ can be obtained by calling F07VGF (DTBCON) with ${\mathbf{NORM}}=\text{'I'}$.

## 8  Parallelism and Performance

F07VEF (DTBTRS) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
F07VEF (DTBTRS) 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 floating-point operations is approximately $2nkr$ if $k\ll n$.
The complex analogue of this routine is F07VSF (ZTBTRS).

## 10  Example

This example solves the system of equations $AX=B$, where
 $A= -4.16 0.00 0.00 0.00 -2.25 4.78 0.00 0.00 0.00 5.86 6.32 0.00 0.00 0.00 -4.82 0.16 and B= -16.64 -4.16 -13.78 -16.59 13.10 -4.94 -14.14 -9.96 .$
Here $A$ is treated as a lower triangular band matrix with one subdiagonal.

### 10.1  Program Text

Program Text (f07vefe.f90)

### 10.2  Program Data

Program Data (f07vefe.d)

### 10.3  Program Results

Program Results (f07vefe.r)