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

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]. Array of dimension (n-1).

inout
D

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

inout
DU

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. Array of dimension (n-1).

inout
B

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. Array of dimension (ldb, nrhs).

in
ldb

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

out
info

  • = 0: successful exit

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

  • > 0: if info = i, U(i-1,i-1) is exactly zero (0-based), 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

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]. Array of dimension (n-1).

inout
D

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

inout
DU

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. Array of dimension (n-1).

inout
B

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. Array of dimension (ldb, nrhs).

in
ldb

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

out
info

  • = 0: successful exit

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

  • > 0: if info = i, U(i-1,i-1) is exactly zero (0-based), 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

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]. Array of dimension (n-1).

inout
D

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

inout
DU

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. Array of dimension (n-1).

inout
B

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. Array of dimension (ldb, nrhs).

in
ldb

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

out
info

  • = 0: successful exit

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

  • > 0: if info = i, U(i-1,i-1) is exactly zero (0-based), 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

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]. Array of dimension (n-1).

inout
D

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

inout
DU

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. Array of dimension (n-1).

inout
B

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. Array of dimension (ldb, nrhs).

in
ldb

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

out
info

  • = 0: successful exit

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

  • > 0: if info = i, U(i-1,i-1) is exactly zero (0-based), and the solution has not been computed. The factorization has not been completed unless i = n.