Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_lapack_zgbtrf (f07br)

## Purpose

nag_lapack_zgbtrf (f07br) computes the LU$LU$ factorization of a complex m$m$ by n$n$ band matrix.

## Syntax

[ab, ipiv, info] = f07br(m, kl, ku, ab, 'n', n)
[ab, ipiv, info] = nag_lapack_zgbtrf(m, kl, ku, ab, 'n', n)

## Description

nag_lapack_zgbtrf (f07br) forms the LU$LU$ factorization of a complex m$m$ by n$n$ band matrix A$A$ using partial pivoting, with row interchanges. Usually m = n$m=n$, and then, if A$A$ has kl${k}_{l}$ nonzero subdiagonals and ku${k}_{u}$ nonzero superdiagonals, the factorization has the form A = PLU$A=PLU$, where P$P$ is a permutation matrix, L$L$ is a lower triangular matrix with unit diagonal elements and at most kl${k}_{l}$ nonzero elements in each column, and U$U$ is an upper triangular band matrix with kl + ku${k}_{l}+{k}_{u}$ superdiagonals.
Note that L$L$ is not a band matrix, but the nonzero elements of L$L$ can be stored in the same space as the subdiagonal elements of A$A$. U$U$ is a band matrix but with kl${k}_{l}$ additional superdiagonals compared with A$A$. These additional superdiagonals are created by the row interchanges.

## References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

## Parameters

### Compulsory Input Parameters

1:     m – int64int32nag_int scalar
m$m$, the number of rows of the matrix A$A$.
Constraint: m0${\mathbf{m}}\ge 0$.
2:     kl – int64int32nag_int scalar
kl${k}_{l}$, the number of subdiagonals within the band of the matrix A$A$.
Constraint: kl0${\mathbf{kl}}\ge 0$.
3:     ku – int64int32nag_int scalar
ku${k}_{u}$, the number of superdiagonals within the band of the matrix A$A$.
Constraint: ku0${\mathbf{ku}}\ge 0$.
4:     ab(ldab, : $:$) – complex array
The first dimension of the array ab must be at least 2 × kl + ku + 1$2×{\mathbf{kl}}+{\mathbf{ku}}+1$
The second dimension of the array must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The m$m$ by n$n$ matrix A$A$.
The matrix is stored in rows kl + 1${k}_{l}+1$ to 2kl + ku + 1$2{k}_{l}+{k}_{u}+1$; the first kl${k}_{l}$ rows need not be set, more precisely, the element Aij${A}_{ij}$ must be stored in
 ab(kl + ku + 1 + i − j,j) = Aij  for ​max (1,j − ku) ≤ i ≤ min (m,j + kl).$abkl+ku+1+i-jj=Aij for ​max(1,j-ku)≤i≤min(m,j+kl).$
See Section [Further Comments] in (f07bn) for further details.

### Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The second dimension of the array ab.
n$n$, the number of columns of the matrix A$A$.
Constraint: n0${\mathbf{n}}\ge 0$.

ldab

### Output Parameters

1:     ab(ldab, : $:$) – complex array
The first dimension of the array ab will be 2 × kl + ku + 1$2×{\mathbf{kl}}+{\mathbf{ku}}+1$
The second dimension of the array will be max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
ldab2 × kl + ku + 1$\mathit{ldab}\ge 2×{\mathbf{kl}}+{\mathbf{ku}}+1$.
If info0${\mathbf{info}}\ge 0$, ab stores details of the factorization.
The upper triangular band matrix U$U$, with kl + ku${k}_{l}+{k}_{u}$ superdiagonals, is stored in rows 1$1$ to kl + ku + 1${k}_{l}+{k}_{u}+1$ of the array, and the multipliers used to form the matrix L$L$ are stored in rows kl + ku + 2${k}_{l}+{k}_{u}+2$ to 2kl + ku + 1$2{k}_{l}+{k}_{u}+1$.
2:     ipiv(min (m,n)$\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{m}},{\mathbf{n}}\right)$) – int64int32nag_int array
The pivot indices that define the permutation matrix. At the i$\mathit{i}$th step, if ipiv(i) > i${\mathbf{ipiv}}\left(\mathit{i}\right)>\mathit{i}$ then row i$\mathit{i}$ of the matrix A$A$ was interchanged with row ipiv(i)${\mathbf{ipiv}}\left(\mathit{i}\right)$, for i = 1,2,,min (m,n)$\mathit{i}=1,2,\dots ,\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(m,n\right)$. ipiv(i)i${\mathbf{ipiv}}\left(i\right)\le i$ indicates that, at the i$i$th step, a row interchange was not required.
3:     info – int64int32nag_int scalar
info = 0${\mathbf{info}}=0$ unless the function detects an error (see Section [Error Indicators and Warnings]).

## Error Indicators and Warnings

Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.

info = i${\mathbf{info}}=-i$
If info = i${\mathbf{info}}=-i$, parameter i$i$ had an illegal value on entry. The parameters are numbered as follows:
1: m, 2: n, 3: kl, 4: ku, 5: ab, 6: ldab, 7: ipiv, 8: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
W INFO > 0${\mathbf{INFO}}>0$
If info = i${\mathbf{info}}=i$, U(i,i)$U\left(i,i\right)$ is exactly zero. The factorization has been completed, but the factor U$U$ is exactly singular, and division by zero will occur if it is used to solve a system of equations.

## Accuracy

The computed factors L$L$ and U$U$ are the exact factors of a perturbed matrix A + E$A+E$, where
 |E| ≤ c(k)εP|L||U| , $|E|≤c(k)εP|L||U| ,$
c(k)$c\left(k\right)$ is a modest linear function of k = kl + ku + 1$k={k}_{l}+{k}_{u}+1$, and ε$\epsilon$ is the machine precision. This assumes k min (m,n) $k\ll \mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(m,n\right)$.

The total number of real floating point operations varies between approximately 8nkl(ku + 1)$8n{k}_{l}\left({k}_{u}+1\right)$ and 8nkl(kl + ku + 1)$8n{k}_{l}\left({k}_{l}+{k}_{u}+1\right)$, depending on the interchanges, assuming m = nkl$m=n\gg {k}_{l}$ and nku$n\gg {k}_{u}$.
A call to nag_lapack_zgbtrf (f07br) may be followed by calls to the functions:
• nag_lapack_zgbtrs (f07bs) to solve AX = B$AX=B$, ATX = B${A}^{\mathrm{T}}X=B$ or AHX = B${A}^{\mathrm{H}}X=B$;
• nag_lapack_zgbcon (f07bu) to estimate the condition number of A$A$.
The real analogue of this function is nag_lapack_dgbtrf (f07bd).

## Example

```function nag_lapack_zgbtrf_example
m = int64(4);
kl = int64(1);
ku = int64(2);
ab = [complex(0),  0 + 0i,  0 + 0i,  0 + 0i;
0 + 0i,  0 + 0i,  0.97 - 2.84i,  0.59 - 0.48i;
0 + 0i,  -2.05 - 0.85i,  -3.99 + 4.01i,  3.33 - 1.04i;
-1.65 + 2.26i,  -1.48 - 1.75i,  -1.06 + 1.94i,  -0.46 - 1.72i;
0 + 6.3i,  -0.77 + 2.83i,  4.48 - 1.09i,  0 + 0i];
[abOut, ipiv, info] = nag_lapack_zgbtrf(m, kl, ku, ab)
```
```

0.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i   0.5900 - 0.4800i
0.0000 + 0.0000i   0.0000 + 0.0000i  -3.9900 + 4.0100i   3.3300 - 1.0400i
0.0000 + 0.0000i  -1.4800 - 1.7500i  -1.0600 + 1.9400i  -1.7692 - 1.8587i
0.0000 + 6.3000i  -0.7700 + 2.8300i   4.9303 - 3.0086i   0.4338 + 0.1233i
0.3587 + 0.2619i   0.2314 + 0.6358i   0.7604 + 0.2429i   0.0000 + 0.0000i

ipiv =

2
3
3
4

info =

0

```
```function f07br_example
m = int64(4);
kl = int64(1);
ku = int64(2);
ab = [complex(0),  0 + 0i,  0 + 0i,  0 + 0i;
0 + 0i,  0 + 0i,  0.97 - 2.84i,  0.59 - 0.48i;
0 + 0i,  -2.05 - 0.85i,  -3.99 + 4.01i,  3.33 - 1.04i;
-1.65 + 2.26i,  -1.48 - 1.75i,  -1.06 + 1.94i,  -0.46 - 1.72i;
0 + 6.3i,  -0.77 + 2.83i,  4.48 - 1.09i,  0 + 0i];
[abOut, ipiv, info] = f07br(m, kl, ku, ab)
```
```

0.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i   0.5900 - 0.4800i
0.0000 + 0.0000i   0.0000 + 0.0000i  -3.9900 + 4.0100i   3.3300 - 1.0400i
0.0000 + 0.0000i  -1.4800 - 1.7500i  -1.0600 + 1.9400i  -1.7692 - 1.8587i
0.0000 + 6.3000i  -0.7700 + 2.8300i   4.9303 - 3.0086i   0.4338 + 0.1233i
0.3587 + 0.2619i   0.2314 + 0.6358i   0.7604 + 0.2429i   0.0000 + 0.0000i

ipiv =

2
3
3
4

info =

0

```

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013