gtsv#

Functions

void sgtsv(
    const INT           n,
    const INT           nrhs,
          f32* restrict DL,
          f32* restrict D,
          f32* restrict DU,
          f32* restrict B,
    const INT           ldb,
          INT*          info
);
void sgtsv(const INT n, const INT nrhs, f32 *restrict DL, f32 *restrict D, f32 *restrict DU, f32 *restrict B, const INT ldb, INT *info)#

SGTSV solves the equation.

A * X = B

where A is an n by n tridiagonal matrix, by Gaussian elimination with partial pivoting.

Note that the equation A**T*X = B may be solved by interchanging the order of the arguments DU and DL.

Parameters

in
n

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

in
nrhs

The number of right hand sides, i.e., the number of columns of the matrix B. nrhs>=0.

inout
DL

Array of dimension (n-1). On entry, the (n-1) sub-diagonal elements of A. On exit, DL is overwritten by the (n-2) elements of the second super-diagonal of the upper triangular matrix U from the LU factorization of A, in DL[0], …, DL[n-3].

inout
D

Array of dimension (n). On entry, the diagonal elements of A. On exit, D is overwritten by the n diagonal elements of U.

inout
DU

Array of dimension (n-1). On entry, the (n-1) super-diagonal elements of A. On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U.

inout
B

Array of dimension (ldb, nrhs). On entry, the n by nrhs matrix of right hand side matrix B. On exit, if info=0, the n by nrhs solution matrix X.

in
ldb

The leading dimension of the array B. ldb>=max(1,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, and the solution has not been computed. The factorization has not been completed unless i = n.

Functions

void dgtsv(
    const INT           n,
    const INT           nrhs,
          f64* restrict DL,
          f64* restrict D,
          f64* restrict DU,
          f64* restrict B,
    const INT           ldb,
          INT*          info
);
void dgtsv(const INT n, const INT nrhs, f64 *restrict DL, f64 *restrict D, f64 *restrict DU, f64 *restrict B, const INT ldb, INT *info)#

DGTSV solves the equation.

A * X = B

where A is an n by n tridiagonal matrix, by Gaussian elimination with partial pivoting.

Note that the equation A**T*X = B may be solved by interchanging the order of the arguments DU and DL.

Parameters

in
n

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

in
nrhs

The number of right hand sides, i.e., the number of columns of the matrix B. nrhs>=0.

inout
DL

Array of dimension (n-1). On entry, the (n-1) sub-diagonal elements of A. On exit, DL is overwritten by the (n-2) elements of the second super-diagonal of the upper triangular matrix U from the LU factorization of A, in DL[0], …, DL[n-3].

inout
D

Array of dimension (n). On entry, the diagonal elements of A. On exit, D is overwritten by the n diagonal elements of U.

inout
DU

Array of dimension (n-1). On entry, the (n-1) super-diagonal elements of A. On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U.

inout
B

Array of dimension (ldb, nrhs). On entry, the n by nrhs matrix of right hand side matrix B. On exit, if info=0, the n by nrhs solution matrix X.

in
ldb

The leading dimension of the array B. ldb>=max(1,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, and the solution has not been computed. The factorization has not been completed unless i = n.

Functions

void cgtsv(
    const INT           n,
    const INT           nrhs,
          c64* restrict DL,
          c64* restrict D,
          c64* restrict DU,
          c64* restrict B,
    const INT           ldb,
          INT*          info
);
void cgtsv(const INT n, const INT nrhs, c64 *restrict DL, c64 *restrict D, c64 *restrict DU, c64 *restrict B, const INT ldb, INT *info)#

CGTSV solves the equation.

A * X = B

where A is an n by n tridiagonal matrix, by Gaussian elimination with partial pivoting.

Note that the equation A**T*X = B may be solved by interchanging the order of the arguments DU and DL.

Parameters

in
n

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

in
nrhs

The number of right hand sides, i.e., the number of columns of the matrix B. nrhs>=0.

inout
DL

Array of dimension (n-1). On entry, the (n-1) sub-diagonal elements of A. On exit, DL is overwritten by the (n-2) elements of the second super-diagonal of the upper triangular matrix U from the LU factorization of A, in DL[0], …, DL[n-3].

inout
D

Array of dimension (n). On entry, the diagonal elements of A. On exit, D is overwritten by the n diagonal elements of U.

inout
DU

Array of dimension (n-1). On entry, the (n-1) super-diagonal elements of A. On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U.

inout
B

Array of dimension (ldb, nrhs). On entry, the n by nrhs matrix of right hand side matrix B. On exit, if info=0, the n by nrhs solution matrix X.

in
ldb

The leading dimension of the array B. ldb>=max(1,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, and the solution has not been computed. The factorization has not been completed unless i = n.

Functions

void zgtsv(
    const INT            n,
    const INT            nrhs,
          c128* restrict DL,
          c128* restrict D,
          c128* restrict DU,
          c128* restrict B,
    const INT            ldb,
          INT*           info
);
void zgtsv(const INT n, const INT nrhs, c128 *restrict DL, c128 *restrict D, c128 *restrict DU, c128 *restrict B, const INT ldb, INT *info)#

ZGTSV solves the equation.

A * X = B

where A is an n by n tridiagonal matrix, by Gaussian elimination with partial pivoting.

Note that the equation A**T*X = B may be solved by interchanging the order of the arguments DU and DL.

Parameters

in
n

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

in
nrhs

The number of right hand sides, i.e., the number of columns of the matrix B. nrhs>=0.

inout
DL

Array of dimension (n-1). On entry, the (n-1) sub-diagonal elements of A. On exit, DL is overwritten by the (n-2) elements of the second super-diagonal of the upper triangular matrix U from the LU factorization of A, in DL[0], …, DL[n-3].

inout
D

Array of dimension (n). On entry, the diagonal elements of A. On exit, D is overwritten by the n diagonal elements of U.

inout
DU

Array of dimension (n-1). On entry, the (n-1) super-diagonal elements of A. On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U.

inout
B

Array of dimension (ldb, nrhs). On entry, the n by nrhs matrix of right hand side matrix B. On exit, if info=0, the n by nrhs solution matrix X.

in
ldb

The leading dimension of the array B. ldb>=max(1,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, and the solution has not been computed. The factorization has not been completed unless i = n.