gtsvx#

Functions

void sgtsvx(
    const char*          fact,
    const char*          trans,
    const INT            n,
    const INT            nrhs,
    const f32*  restrict DL,
    const f32*  restrict D,
    const f32*  restrict DU,
          f32*  restrict DLF,
          f32*  restrict DF,
          f32*  restrict DUF,
          f32*  restrict DU2,
          INT*  restrict ipiv,
    const 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 sgtsvx(const char *fact, const char *trans, const INT n, const INT nrhs, const f32 *restrict DL, const f32 *restrict D, const f32 *restrict DU, f32 *restrict DLF, f32 *restrict DF, f32 *restrict DUF, f32 *restrict DU2, INT *restrict ipiv, const 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)#

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

A * X = B  or  A**T * X = B

where A is a tridiagonal matrix of order n 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:

  1. If fact='N', the LU decomposition is used to factor the matrix A as A = L * U, where L is a product of permutation and unit lower bidiagonal matrices and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals.

  2. 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.

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

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

Parameters

in
fact

  • 'F': DLF, DF, DUF, DU2, and ipiv contain the factored form of A.

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

in
trans

Specifies the form of the system of equations:

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

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

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

in
n

The order of the matrix A. n>=0.

in
nrhs

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

in
DL

Array of dimension (n-1). The (n-1) subdiagonal elements of A.

in
D

Array of dimension (n). The diagonal elements of A.

in
DU

Array of dimension (n-1). The (n-1) superdiagonal elements of A.

inout
DLF

Array of dimension (n-1). If fact='F', the (n-1) multipliers from LU factorization. If fact='N', output.

inout
DF

Array of dimension (n). If fact='F', the n diagonal elements of U. If fact='N', output.

inout
DUF

Array of dimension (n-1). If fact='F', the (n-1) elements of first superdiagonal of U. If fact='N', output.

inout
DU2

Array of dimension (n-2). If fact='F', the (n-2) elements of second superdiagonal of U. If fact='N', output.

inout
ipiv

Array of dimension (n). If fact='F', the pivot indices from factorization. If fact='N', output.

in
B

Array of dimension (ldb, nrhs). The n-by-nrhs right hand side matrix.

in
ldb

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

out
X

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

in
ldx

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

out
rcond

The reciprocal condition number estimate.

out
ferr

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

out
berr

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

out
work

Workspace array of dimension (3*n).

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 (i <= n), U(i,i) is exactly zero

  • info=n+1: U is nonsingular, but rcond < machine precision

Functions

void dgtsvx(
    const char*          fact,
    const char*          trans,
    const INT            n,
    const INT            nrhs,
    const f64*  restrict DL,
    const f64*  restrict D,
    const f64*  restrict DU,
          f64*  restrict DLF,
          f64*  restrict DF,
          f64*  restrict DUF,
          f64*  restrict DU2,
          INT*  restrict ipiv,
    const 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 dgtsvx(const char *fact, const char *trans, const INT n, const INT nrhs, const f64 *restrict DL, const f64 *restrict D, const f64 *restrict DU, f64 *restrict DLF, f64 *restrict DF, f64 *restrict DUF, f64 *restrict DU2, INT *restrict ipiv, const 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)#

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

A * X = B  or  A**T * X = B

where A is a tridiagonal matrix of order n 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:

  1. If fact='N', the LU decomposition is used to factor the matrix A as A = L * U, where L is a product of permutation and unit lower bidiagonal matrices and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals.

  2. 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.

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

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

Parameters

in
fact

  • 'F': DLF, DF, DUF, DU2, and ipiv contain the factored form of A.

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

in
trans

Specifies the form of the system of equations:

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

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

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

in
n

The order of the matrix A. n>=0.

in
nrhs

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

in
DL

Array of dimension (n-1). The (n-1) subdiagonal elements of A.

in
D

Array of dimension (n). The diagonal elements of A.

in
DU

Array of dimension (n-1). The (n-1) superdiagonal elements of A.

inout
DLF

Array of dimension (n-1). If fact='F', the (n-1) multipliers from LU factorization. If fact='N', output.

inout
DF

Array of dimension (n). If fact='F', the n diagonal elements of U. If fact='N', output.

inout
DUF

Array of dimension (n-1). If fact='F', the (n-1) elements of first superdiagonal of U. If fact='N', output.

inout
DU2

Array of dimension (n-2). If fact='F', the (n-2) elements of second superdiagonal of U. If fact='N', output.

inout
ipiv

Array of dimension (n). If fact='F', the pivot indices from factorization. If fact='N', output.

in
B

Array of dimension (ldb, nrhs). The n-by-nrhs right hand side matrix.

in
ldb

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

out
X

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

in
ldx

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

out
rcond

The reciprocal condition number estimate.

out
ferr

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

out
berr

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

out
work

Workspace array of dimension (3*n).

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 (i <= n), U(i,i) is exactly zero

  • info=n+1: U is nonsingular, but rcond < machine precision

Functions

void cgtsvx(
    const char*          fact,
    const char*          trans,
    const INT            n,
    const INT            nrhs,
    const c64*  restrict DL,
    const c64*  restrict D,
    const c64*  restrict DU,
          c64*  restrict DLF,
          c64*  restrict DF,
          c64*  restrict DUF,
          c64*  restrict DU2,
          INT*  restrict ipiv,
    const 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 cgtsvx(const char *fact, const char *trans, const INT n, const INT nrhs, const c64 *restrict DL, const c64 *restrict D, const c64 *restrict DU, c64 *restrict DLF, c64 *restrict DF, c64 *restrict DUF, c64 *restrict DU2, INT *restrict ipiv, const 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)#

CGTSVX 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 tridiagonal matrix of order n 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:

  1. If fact='N', the LU decomposition is used to factor the matrix A as A = L * U, where L is a product of permutation and unit lower bidiagonal matrices and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals.

  2. 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.

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

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

Parameters

in
fact

  • 'F': DLF, DF, DUF, DU2, and ipiv contain the factored form of A.

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

in
trans

Specifies the form of the system of equations:

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

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

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

in
n

The order of the matrix A. n>=0.

in
nrhs

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

in
DL

Array of dimension (n-1). The (n-1) subdiagonal elements of A.

in
D

Array of dimension (n). The diagonal elements of A.

in
DU

Array of dimension (n-1). The (n-1) superdiagonal elements of A.

inout
DLF

Array of dimension (n-1). If fact='F', the (n-1) multipliers from LU factorization. If fact='N', output.

inout
DF

Array of dimension (n). If fact='F', the n diagonal elements of U. If fact='N', output.

inout
DUF

Array of dimension (n-1). If fact='F', the (n-1) elements of first superdiagonal of U. If fact='N', output.

inout
DU2

Array of dimension (n-2). If fact='F', the (n-2) elements of second superdiagonal of U. If fact='N', output.

inout
ipiv

Array of dimension (n). If fact='F', the pivot indices from factorization. If fact='N', output.

in
B

Array of dimension (ldb, nrhs). The n-by-nrhs right hand side matrix.

in
ldb

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

out
X

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

in
ldx

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

out
rcond

The reciprocal condition number estimate.

out
ferr

Array of dimension (nrhs). Forward error bounds 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 (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 (i <= n), U(i,i) is exactly zero

  • info=n+1: U is nonsingular, but rcond < machine precision

Functions

void zgtsvx(
    const char*          fact,
    const char*          trans,
    const INT            n,
    const INT            nrhs,
    const c128* restrict DL,
    const c128* restrict D,
    const c128* restrict DU,
          c128* restrict DLF,
          c128* restrict DF,
          c128* restrict DUF,
          c128* restrict DU2,
          INT*  restrict ipiv,
    const 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 zgtsvx(const char *fact, const char *trans, const INT n, const INT nrhs, const c128 *restrict DL, const c128 *restrict D, const c128 *restrict DU, c128 *restrict DLF, c128 *restrict DF, c128 *restrict DUF, c128 *restrict DU2, INT *restrict ipiv, const 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)#

ZGTSVX 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 tridiagonal matrix of order n 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:

  1. If fact='N', the LU decomposition is used to factor the matrix A as A = L * U, where L is a product of permutation and unit lower bidiagonal matrices and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals.

  2. 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.

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

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

Parameters

in
fact

  • 'F': DLF, DF, DUF, DU2, and ipiv contain the factored form of A.

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

in
trans

Specifies the form of the system of equations:

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

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

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

in
n

The order of the matrix A. n>=0.

in
nrhs

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

in
DL

Array of dimension (n-1). The (n-1) subdiagonal elements of A.

in
D

Array of dimension (n). The diagonal elements of A.

in
DU

Array of dimension (n-1). The (n-1) superdiagonal elements of A.

inout
DLF

Array of dimension (n-1). If fact='F', the (n-1) multipliers from LU factorization. If fact='N', output.

inout
DF

Array of dimension (n). If fact='F', the n diagonal elements of U. If fact='N', output.

inout
DUF

Array of dimension (n-1). If fact='F', the (n-1) elements of first superdiagonal of U. If fact='N', output.

inout
DU2

Array of dimension (n-2). If fact='F', the (n-2) elements of second superdiagonal of U. If fact='N', output.

inout
ipiv

Array of dimension (n). If fact='F', the pivot indices from factorization. If fact='N', output.

in
B

Array of dimension (ldb, nrhs). The n-by-nrhs right hand side matrix.

in
ldb

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

out
X

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

in
ldx

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

out
rcond

The reciprocal condition number estimate.

out
ferr

Array of dimension (nrhs). Forward error bounds 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 (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 (i <= n), U(i,i) is exactly zero

  • info=n+1: U is nonsingular, but rcond < machine precision