# ?gbtrf

Computes the LU factorization of a general m-by-n band matrix.

## Syntax

FORTRAN 77:

call sgbtrf( m, n, kl, ku, ab, ldab, ipiv, info )

call dgbtrf( m, n, kl, ku, ab, ldab, ipiv, info )

call cgbtrf( m, n, kl, ku, ab, ldab, ipiv, info )

call zgbtrf( m, n, kl, ku, ab, ldab, ipiv, info )

Fortran 95:

call gbtrf( a [,kl] [,m] [,ipiv] [,info] )

## Description

The routine forms the LU factorization of a general m-by-n band matrix A with kl non-zero subdiagonals and ku non-zero superdiagonals. Usually A is square (m = n), and then
`A = P*L*U,`

where P is a permutation matrix; L is lower triangular with unit diagonal elements and at most kl non-zero elements in each column; U is an upper triangular band matrix with kl + ku superdiagonals. The routine uses partial pivoting, with row interchanges (which creates the additional kl superdiagonals in U).

## Input Parameters

m

  INTEGER. The number of rows in matrix `A (m ≥ 0)`.

n

  INTEGER. The number of columns in matrix A; n ≥ 0.

kl

  INTEGER. The number of subdiagonals within the band of A; kl ≥ 0.

ku

  INTEGER. The number of superdiagonals within the band of A; ku ≥ 0.

ab

  REAL for sgbtrf

  DOUBLE PRECISION for dgbtrf

  COMPLEX for cgbtrf

  DOUBLE COMPLEX for zgbtrf.

  Array, DIMENSION `(ldab,*)`. The array ab contains the matrix A in band storage (see Matrix Storage Schemes). The second dimension of ab must be at least `max(1, n)`.

ldab

  INTEGER. The first dimension of the array ab. (ldab ≥ 2*kl + ku + 1)

## Output Parameters

ab

  Overwritten by L and U. The diagonal and `kl + ku` superdiagonals of U are stored in the first `1+kl+ku` rows of ab. The multipliers used to form L are stored in the next kl rows.

ipiv

  INTEGER.

  Array, DIMENSION at least `max(1,min(m, n))`. The pivot indices: row i was interchanged with row `ipiv(i)`.

info

  INTEGER. If `info = 0`, the execution is successful.

  If `info = -i`, the i-th parameter had an illegal value.

  If `info = i, uii` is 0. The factorization has been completed, but U is exactly singular. Division by 0 will occur if you use the factor U for solving a system of linear equations.

## Fortran 95 Interface Notes

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their Fortran 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.

Specific details for the routine gbtrf interface are as follows:

a

  Stands for argument ab in Fortan 77 interface. Holds the array A of size (`2*kl+ku+1,n`).

ipiv

  Holds the vector of length `min(m,n)`.

kl

  If omitted, assumed `kl = ku`.

ku

  Restored as `ku = lda-2*kl-1`.

m

  If omitted, assumed `m = n`.

## Application Notes

The computed L and U are the exact factors of a perturbed matrix A + E, where
`|E| ≤ c(kl+ku+1) ε P|L||U|`

`c(k)` is a modest linear function of k, and ε is the machine precision.

The total number of floating-point operations for real flavors varies between approximately `2n(ku+1)kl` and `2n(kl+ku+1)kl`. The number of operations for complex flavors is four times greater. All these estimates assume that kl and ku are much less than `min(m,n)`.

After calling this routine with `m = n`, you can call the following routines:

gbtrs

  to solve `A*X = B` or `AT*X = B` or `AH*X = B`

gbcon

  to estimate the condition number of A.

Parent topic: Routines for Matrix Factorization