XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ zgtsv()

void zgtsv ( int  n,
int  nrhs,
doublecomplex  dl[],
doublecomplex  d[],
doublecomplex  du[],
int  ldb,
doublecomplex  b[],
int *  info 
)

(Simple driver) Solution to system of linear equations AX = B for a complex tridiagonal matrix

Purpose
This routine solves the equation
A * X = B
where A is an n x 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]nOrder of the matrix A. (n >= 0) (If n = 0, returns without computation)
[in]nrhsNumber of right hand sides, i.e., number of columns of the matrix B. (nrhs >= 0) (if nrhs = 0, returns without computation)
[in,out]dl[]Array dl[ldl] (ldl >= n - 1)
[in] n-1 sub-diagonal elements of A.
[out] 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].
[in,out]d[]Array d[ld] (ld >= n)
[in] Diagonal elements of A.
[out] n diagonal elements of U.
[in,out]du[]Array du[ldu] (ldu >= n - 1)
[in] n-1 super-diagonal elements of A.
[out] n-1 elements of the first super-diagonal of U.
[in]ldbLeading dimension of the two dimensional array b[][]. (ldb >= max(1, n))
[in,out]b[][]Array b[lb][ldb] (lb >= nrhs)
[in] n x nrhs matrix of right hand side matrix B.
[out] If info = 0, n x nrhs solution matrix X.
[out]info= 0: Successful exit
= -1: The argument n had an illegal value (n < 0)
= -2: The argument nrhs had an illegal value (nrhs < 0)
= -6: The argument ldb had an illegal value (ldb < max(1, n))
= i > 0: The i-th diagonal element of the factor U is exactly zero, and the solution has not been computed. The factorization has not been completed unless i = n.
Reference
LAPACK