gbsvx#

Functions

void sgbsvx(
    const char*          fact,
    const char*          trans,
    const INT            n,
    const INT            kl,
    const INT            ku,
    const INT            nrhs,
          f32*  restrict AB,
    const INT            ldab,
          f32*  restrict AFB,
    const INT            ldafb,
          INT*  restrict ipiv,
          char*          equed,
          f32*  restrict R,
          f32*  restrict C,
          f32*  restrict B,
    const INT            ldb,
          f32*  restrict X,
    const INT            ldx,
          f32*           rcond,
          f32*  restrict ferr,
          f32*  restrict berr,
          f32*  restrict work,
          INT*  restrict iwork,
          INT*           info
);
void sgbsvx(const char *fact, const char *trans, const INT n, const INT kl, const INT ku, const INT nrhs, f32 *restrict AB, const INT ldab, f32 *restrict AFB, const INT ldafb, INT *restrict ipiv, char *equed, f32 *restrict R, f32 *restrict C, f32 *restrict B, const INT ldb, f32 *restrict X, const INT ldx, f32 *rcond, f32 *restrict ferr, f32 *restrict berr, f32 *restrict work, INT *restrict iwork, INT *info)#

SGBSVX uses the LU factorization to compute the solution to a real system of linear equations.

A * X = B,  A**T * X = B,  or  A**H * X = B

where A is a band matrix of order n with kl subdiagonals and ku superdiagonals, and X and B are n-by-nrhs matrices.

Error bounds on the solution and a condition estimate are also provided.

The following steps are performed by this subroutine:

  1. If fact='E', real scaling factors are computed to equilibrate the system:

    trans = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
    trans = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    trans = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    

    Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if trans='N') or diag(C)*B (if trans='T' or 'C').

  2. If fact='N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact='E') as:

    A = L * U
    

    where L is a product of permutation and unit lower triangular matrices with kl subdiagonals, and U is upper triangular with kl+ku superdiagonals.

  3. If some U(i,i)=0, so that U is exactly singular, then the routine returns with info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, info=n+1 is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.

  4. The system of equations is solved for X using the factored form of A.

  5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.

  6. If equilibration was used, the matrix X is premultiplied by diag(C) (if trans='N') or diag(R) (if trans='T' or 'C') so that it solves the original system before equilibration.

Parameters

in
fact

  • 'F': AFB and ipiv contain the factored form of A.

  • 'N': The matrix A will be copied to AFB and factored.

  • 'E': The matrix A will be equilibrated if necessary, then copied to AFB and factored.

in
trans

  • 'N': A * X = B (No transpose)

  • 'T': A**T * X = B (Transpose)

  • 'C': A**H * X = B (Conjugate transpose = Transpose)

in
n

The number of linear equations (order of A). n>=0.

in
kl

The number of subdiagonals within the band of A. kl>=0.

in
ku

The number of superdiagonals within the band of A. ku>=0.

in
nrhs

The number of right hand sides. nrhs>=0.

inout
AB

Array of dimension (ldab, n). On entry, the matrix A in band storage, in rows 0 to kl+ku. The j-th column of A is stored in the j-th column of the array AB as follows: AB[ku+i-j + j*ldab] = A(i,j) for max(0,j-ku)<=i<=min(n-1,j+kl). On exit, if equed != 'N', A is scaled.

in
ldab

The leading dimension of AB. ldab>=kl+ku+1.

inout
AFB

Array of dimension (ldafb, n). On entry (if fact='F'), contains the LU factors. On exit, contains the factors L and U.

in
ldafb

The leading dimension of AFB. ldafb>=2*kl+ku+1.

inout
ipiv

Array of dimension (n). Pivot indices from factorization.

inout
equed

On entry (if fact='F'), specifies equilibration done. On exit, specifies the form of equilibration:

  • 'N': No equilibration

  • 'R': Row equilibration (A := diag(R) * A)

  • 'C': Column equilibration (A := A * diag(C))

  • 'B': Both (A := diag(R) * A * diag(C))

inout
R

Array of dimension (n). Row scale factors.

inout
C

Array of dimension (n). Column scale factors.

inout
B

Array of dimension (ldb, nrhs). On entry, the n-by-nrhs right hand side matrix B. On exit, if equilibration was done, B is scaled.

in
ldb

The leading dimension of B. ldb>=max(1,n).

out
X

Array of dimension (ldx, nrhs). The n-by-nrhs solution matrix X.

in
ldx

The leading dimension of X. ldx>=max(1,n).

out
rcond

Reciprocal condition number estimate.

out
ferr

Array of dimension (nrhs). Forward error bound for each solution vector.

out
berr

Array of dimension (nrhs). Backward error for each solution vector.

out
work

Workspace array of dimension (3*n). On exit, work[0] contains the reciprocal pivot growth factor.

out
iwork

Integer workspace array of dimension (n).

out
info

  • info=0: successful exit

  • info<0: if info=-i, the i-th argument had an illegal value

  • info>0: if info=i, U(i,i) is exactly zero (1-based). If info=n+1, U is nonsingular but rcond < machine precision.

Functions

void dgbsvx(
    const char*          fact,
    const char*          trans,
    const INT            n,
    const INT            kl,
    const INT            ku,
    const INT            nrhs,
          f64*  restrict AB,
    const INT            ldab,
          f64*  restrict AFB,
    const INT            ldafb,
          INT*  restrict ipiv,
          char*          equed,
          f64*  restrict R,
          f64*  restrict C,
          f64*  restrict B,
    const INT            ldb,
          f64*  restrict X,
    const INT            ldx,
          f64*           rcond,
          f64*  restrict ferr,
          f64*  restrict berr,
          f64*  restrict work,
          INT*  restrict iwork,
          INT*           info
);
void dgbsvx(const char *fact, const char *trans, const INT n, const INT kl, const INT ku, const INT nrhs, f64 *restrict AB, const INT ldab, f64 *restrict AFB, const INT ldafb, INT *restrict ipiv, char *equed, f64 *restrict R, f64 *restrict C, f64 *restrict B, const INT ldb, f64 *restrict X, const INT ldx, f64 *rcond, f64 *restrict ferr, f64 *restrict berr, f64 *restrict work, INT *restrict iwork, INT *info)#

DGBSVX uses the LU factorization to compute the solution to a real system of linear equations.

A * X = B,  A**T * X = B,  or  A**H * X = B

where A is a band matrix of order n with kl subdiagonals and ku superdiagonals, and X and B are n-by-nrhs matrices.

Error bounds on the solution and a condition estimate are also provided.

The following steps are performed by this subroutine:

  1. If fact='E', real scaling factors are computed to equilibrate the system:

    trans = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
    trans = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    trans = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    

    Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if trans='N') or diag(C)*B (if trans='T' or 'C').

  2. If fact='N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact='E') as:

    A = L * U
    

    where L is a product of permutation and unit lower triangular matrices with kl subdiagonals, and U is upper triangular with kl+ku superdiagonals.

  3. If some U(i,i)=0, so that U is exactly singular, then the routine returns with info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, info=n+1 is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.

  4. The system of equations is solved for X using the factored form of A.

  5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.

  6. If equilibration was used, the matrix X is premultiplied by diag(C) (if trans='N') or diag(R) (if trans='T' or 'C') so that it solves the original system before equilibration.

Parameters

in
fact

  • 'F': AFB and ipiv contain the factored form of A.

  • 'N': The matrix A will be copied to AFB and factored.

  • 'E': The matrix A will be equilibrated if necessary, then copied to AFB and factored.

in
trans

  • 'N': A * X = B (No transpose)

  • 'T': A**T * X = B (Transpose)

  • 'C': A**H * X = B (Conjugate transpose = Transpose)

in
n

The number of linear equations (order of A). n>=0.

in
kl

The number of subdiagonals within the band of A. kl>=0.

in
ku

The number of superdiagonals within the band of A. ku>=0.

in
nrhs

The number of right hand sides. nrhs>=0.

inout
AB

Array of dimension (ldab, n). On entry, the matrix A in band storage, in rows 0 to kl+ku. The j-th column of A is stored in the j-th column of the array AB as follows: AB[ku+i-j + j*ldab] = A(i,j) for max(0,j-ku)<=i<=min(n-1,j+kl). On exit, if equed != 'N', A is scaled.

in
ldab

The leading dimension of AB. ldab>=kl+ku+1.

inout
AFB

Array of dimension (ldafb, n). On entry (if fact='F'), contains the LU factors. On exit, contains the factors L and U.

in
ldafb

The leading dimension of AFB. ldafb>=2*kl+ku+1.

inout
ipiv

Array of dimension (n). Pivot indices from factorization.

inout
equed

On entry (if fact='F'), specifies equilibration done. On exit, specifies the form of equilibration:

  • 'N': No equilibration

  • 'R': Row equilibration (A := diag(R) * A)

  • 'C': Column equilibration (A := A * diag(C))

  • 'B': Both (A := diag(R) * A * diag(C))

inout
R

Array of dimension (n). Row scale factors.

inout
C

Array of dimension (n). Column scale factors.

inout
B

Array of dimension (ldb, nrhs). On entry, the n-by-nrhs right hand side matrix B. On exit, if equilibration was done, B is scaled.

in
ldb

The leading dimension of B. ldb>=max(1,n).

out
X

Array of dimension (ldx, nrhs). The n-by-nrhs solution matrix X.

in
ldx

The leading dimension of X. ldx>=max(1,n).

out
rcond

Reciprocal condition number estimate.

out
ferr

Array of dimension (nrhs). Forward error bound for each solution vector.

out
berr

Array of dimension (nrhs). Backward error for each solution vector.

out
work

Workspace array of dimension (3*n). On exit, work[0] contains the reciprocal pivot growth factor.

out
iwork

Integer workspace array of dimension (n).

out
info

  • info=0: successful exit

  • info<0: if info=-i, the i-th argument had an illegal value

  • info>0: if info=i, U(i,i) is exactly zero (1-based). If info=n+1, U is nonsingular but rcond < machine precision.

Functions

void cgbsvx(
    const char*          fact,
    const char*          trans,
    const INT            n,
    const INT            kl,
    const INT            ku,
    const INT            nrhs,
          c64*  restrict AB,
    const INT            ldab,
          c64*  restrict AFB,
    const INT            ldafb,
          INT*  restrict ipiv,
          char*          equed,
          f32*  restrict R,
          f32*  restrict C,
          c64*  restrict B,
    const INT            ldb,
          c64*  restrict X,
    const INT            ldx,
          f32*           rcond,
          f32*  restrict ferr,
          f32*  restrict berr,
          c64*  restrict work,
          f32*  restrict rwork,
          INT*           info
);
void cgbsvx(const char *fact, const char *trans, const INT n, const INT kl, const INT ku, const INT nrhs, c64 *restrict AB, const INT ldab, c64 *restrict AFB, const INT ldafb, INT *restrict ipiv, char *equed, f32 *restrict R, f32 *restrict C, c64 *restrict B, const INT ldb, c64 *restrict X, const INT ldx, f32 *rcond, f32 *restrict ferr, f32 *restrict berr, c64 *restrict work, f32 *restrict rwork, INT *info)#

CGBSVX uses the LU factorization to compute the solution to a complex system of linear equations.

A * X = B,  A**T * X = B,  or  A**H * X = B

where A is a band matrix of order n with kl subdiagonals and ku superdiagonals, and X and B are n-by-nrhs matrices.

Error bounds on the solution and a condition estimate are also provided.

The following steps are performed by this subroutine:

  1. If fact='E', real scaling factors are computed to equilibrate the system:

    trans = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
    trans = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    trans = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    

    Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if trans='N') or diag(C)*B (if trans='T' or 'C').

  2. If fact='N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact='E') as:

    A = L * U
    

    where L is a product of permutation and unit lower triangular matrices with kl subdiagonals, and U is upper triangular with kl+ku superdiagonals.

  3. If some U(i,i)=0, so that U is exactly singular, then the routine returns with info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, info=n+1 is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.

  4. The system of equations is solved for X using the factored form of A.

  5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.

  6. If equilibration was used, the matrix X is premultiplied by diag(C) (if trans='N') or diag(R) (if trans='T' or 'C') so that it solves the original system before equilibration.

Parameters

in
fact

  • 'F': AFB and ipiv contain the factored form of A.

  • 'N': The matrix A will be copied to AFB and factored.

  • 'E': The matrix A will be equilibrated if necessary, then copied to AFB and factored.

in
trans

  • 'N': A * X = B (No transpose)

  • 'T': A**T * X = B (Transpose)

  • 'C': A**H * X = B (Conjugate transpose)

in
n

The number of linear equations (order of A). n>=0.

in
kl

The number of subdiagonals within the band of A. kl>=0.

in
ku

The number of superdiagonals within the band of A. ku>=0.

in
nrhs

The number of right hand sides. nrhs>=0.

inout
AB

Array of dimension (ldab, n). On entry, the matrix A in band storage, in rows 0 to kl+ku. The j-th column of A is stored in the j-th column of the array AB as follows: AB[ku+i-j + j*ldab] = A(i,j) for max(0,j-ku)<=i<=min(n-1,j+kl). On exit, if equed != 'N', A is scaled.

in
ldab

The leading dimension of AB. ldab>=kl+ku+1.

inout
AFB

Array of dimension (ldafb, n). On entry (if fact='F'), contains the LU factors. On exit, contains the factors L and U.

in
ldafb

The leading dimension of AFB. ldafb>=2*kl+ku+1.

inout
ipiv

Array of dimension (n). Pivot indices from factorization.

inout
equed

On entry (if fact='F'), specifies equilibration done. On exit, specifies the form of equilibration:

  • 'N': No equilibration

  • 'R': Row equilibration (A := diag(R) * A)

  • 'C': Column equilibration (A := A * diag(C))

  • 'B': Both (A := diag(R) * A * diag(C))

inout
R

Array of dimension (n). Row scale factors.

inout
C

Array of dimension (n). Column scale factors.

inout
B

Array of dimension (ldb, nrhs). On entry, the n-by-nrhs right hand side matrix B. On exit, if equilibration was done, B is scaled.

in
ldb

The leading dimension of B. ldb>=max(1,n).

out
X

Array of dimension (ldx, nrhs). The n-by-nrhs solution matrix X.

in
ldx

The leading dimension of X. ldx>=max(1,n).

out
rcond

Reciprocal condition number estimate.

out
ferr

Array of dimension (nrhs). Forward error bound for each solution vector.

out
berr

Array of dimension (nrhs). Backward error for each solution vector.

out
work

Complex workspace array of dimension (2*n).

out
rwork

Real workspace array of dimension (max(1,n)). On exit, rwork[0] contains the reciprocal pivot growth factor.

out
info

  • info=0: successful exit

  • info<0: if info=-i, the i-th argument had an illegal value

  • info>0: if info=i, U(i,i) is exactly zero (1-based). If info=n+1, U is nonsingular but rcond < machine precision.

Functions

void zgbsvx(
    const char*          fact,
    const char*          trans,
    const INT            n,
    const INT            kl,
    const INT            ku,
    const INT            nrhs,
          c128* restrict AB,
    const INT            ldab,
          c128* restrict AFB,
    const INT            ldafb,
          INT*  restrict ipiv,
          char*          equed,
          f64*  restrict R,
          f64*  restrict C,
          c128* restrict B,
    const INT            ldb,
          c128* restrict X,
    const INT            ldx,
          f64*           rcond,
          f64*  restrict ferr,
          f64*  restrict berr,
          c128* restrict work,
          f64*  restrict rwork,
          INT*           info
);
void zgbsvx(const char *fact, const char *trans, const INT n, const INT kl, const INT ku, const INT nrhs, c128 *restrict AB, const INT ldab, c128 *restrict AFB, const INT ldafb, INT *restrict ipiv, char *equed, f64 *restrict R, f64 *restrict C, c128 *restrict B, const INT ldb, c128 *restrict X, const INT ldx, f64 *rcond, f64 *restrict ferr, f64 *restrict berr, c128 *restrict work, f64 *restrict rwork, INT *info)#

ZGBSVX uses the LU factorization to compute the solution to a complex system of linear equations.

A * X = B,  A**T * X = B,  or  A**H * X = B

where A is a band matrix of order n with kl subdiagonals and ku superdiagonals, and X and B are n-by-nrhs matrices.

Error bounds on the solution and a condition estimate are also provided.

The following steps are performed by this subroutine:

  1. If fact='E', real scaling factors are computed to equilibrate the system:

    trans = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
    trans = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    trans = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    

    Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if trans='N') or diag(C)*B (if trans='T' or 'C').

  2. If fact='N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if fact='E') as:

    A = L * U
    

    where L is a product of permutation and unit lower triangular matrices with kl subdiagonals, and U is upper triangular with kl+ku superdiagonals.

  3. If some U(i,i)=0, so that U is exactly singular, then the routine returns with info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, info=n+1 is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.

  4. The system of equations is solved for X using the factored form of A.

  5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.

  6. If equilibration was used, the matrix X is premultiplied by diag(C) (if trans='N') or diag(R) (if trans='T' or 'C') so that it solves the original system before equilibration.

Parameters

in
fact

  • 'F': AFB and ipiv contain the factored form of A.

  • 'N': The matrix A will be copied to AFB and factored.

  • 'E': The matrix A will be equilibrated if necessary, then copied to AFB and factored.

in
trans

  • 'N': A * X = B (No transpose)

  • 'T': A**T * X = B (Transpose)

  • 'C': A**H * X = B (Conjugate transpose)

in
n

The number of linear equations (order of A). n>=0.

in
kl

The number of subdiagonals within the band of A. kl>=0.

in
ku

The number of superdiagonals within the band of A. ku>=0.

in
nrhs

The number of right hand sides. nrhs>=0.

inout
AB

Array of dimension (ldab, n). On entry, the matrix A in band storage, in rows 0 to kl+ku. The j-th column of A is stored in the j-th column of the array AB as follows: AB[ku+i-j + j*ldab] = A(i,j) for max(0,j-ku)<=i<=min(n-1,j+kl). On exit, if equed != 'N', A is scaled.

in
ldab

The leading dimension of AB. ldab>=kl+ku+1.

inout
AFB

Array of dimension (ldafb, n). On entry (if fact='F'), contains the LU factors. On exit, contains the factors L and U.

in
ldafb

The leading dimension of AFB. ldafb>=2*kl+ku+1.

inout
ipiv

Array of dimension (n). Pivot indices from factorization.

inout
equed

On entry (if fact='F'), specifies equilibration done. On exit, specifies the form of equilibration:

  • 'N': No equilibration

  • 'R': Row equilibration (A := diag(R) * A)

  • 'C': Column equilibration (A := A * diag(C))

  • 'B': Both (A := diag(R) * A * diag(C))

inout
R

Array of dimension (n). Row scale factors.

inout
C

Array of dimension (n). Column scale factors.

inout
B

Array of dimension (ldb, nrhs). On entry, the n-by-nrhs right hand side matrix B. On exit, if equilibration was done, B is scaled.

in
ldb

The leading dimension of B. ldb>=max(1,n).

out
X

Array of dimension (ldx, nrhs). The n-by-nrhs solution matrix X.

in
ldx

The leading dimension of X. ldx>=max(1,n).

out
rcond

Reciprocal condition number estimate.

out
ferr

Array of dimension (nrhs). Forward error bound for each solution vector.

out
berr

Array of dimension (nrhs). Backward error for each solution vector.

out
work

Complex workspace array of dimension (2*n).

out
rwork

Real workspace array of dimension (max(1,n)). On exit, rwork[0] contains the reciprocal pivot growth factor.

out
info

  • info=0: successful exit

  • info<0: if info=-i, the i-th argument had an illegal value

  • info>0: if info=i, U(i,i) is exactly zero (1-based). If info=n+1, U is nonsingular but rcond < machine precision.