?gtsv
?gtsv
Computes the solution to the system of linear equations with a tridiagonal coefficient matrix A and multiple right-hand sides.
Syntax
lapack_int
LAPACKE_sgtsv
(
int
matrix_layout
,
lapack_int
n
,
lapack_int
nrhs
,
float
*
dl
,
float
*
d
,
float
*
du
,
float
*
b
,
lapack_int
ldb
);
lapack_int
LAPACKE_dgtsv
(
int
matrix_layout
,
lapack_int
n
,
lapack_int
nrhs
,
double
*
dl
,
double
*
d
,
double
*
du
,
double
*
b
,
lapack_int
ldb
);
lapack_int
LAPACKE_cgtsv
(
int
matrix_layout
,
lapack_int
n
,
lapack_int
nrhs
,
lapack_complex_float
*
dl
,
lapack_complex_float
*
d
,
lapack_complex_float
*
du
,
lapack_complex_float
*
b
,
lapack_int
ldb
);
lapack_int
LAPACKE_zgtsv
(
int
matrix_layout
,
lapack_int
n
,
lapack_int
nrhs
,
lapack_complex_double
*
dl
,
lapack_complex_double
*
d
,
lapack_complex_double
*
du
,
lapack_complex_double
*
b
,
lapack_int
ldb
);
Include Files
- mkl.h
Description
The routine solves for , where
X
the system of linear equations A*X
= B
A
is an n
-by-n
tridiagonal matrix, the columns of matrix B
are individual right-hand sides, and the columns of X
are the corresponding solutions. The routine uses 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
.Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- n
- The order ofA, the number of rows inB;n≥0.
- nrhs
- The number of right-hand sides, the number of columns in.B;nrhs≥0
- dl
- The arraydl(sizen- 1) contains the(subdiagonal elements ofn- 1)A.
- d
- The arrayd(sizen) contains the diagonal elements ofA.
- du
- The arraydu(sizen- 1) contains the(superdiagonal elements ofn- 1)A.
- b
- The arraybof size max(1,contains the matrixldb*nrhs) for column major layout and max(1,ldb*n) for row major layoutBwhose columns are the right-hand sides for the systems of equations.
- ldb
- The leading dimension ofb;.ldb≥max(1,n) for column major layout andldb≥nrhsfor row major layout
Output Parameters
- dl
- Overwritten by the(elements of the second superdiagonal of the upper triangular matrixn-2)Ufrom theLUfactorization of A. These elements are stored in.dl[0], ...,dl[n- 3]
- d
- Overwritten by thendiagonal elements ofU.
- du
- Overwritten by the(elements of the first superdiagonal ofn-1)U.
- b
- Overwritten by the solution matrixX.
Return Values
This function returns a value
info
.If , the execution is successful.
info
= 0If , parameter
info
= -i
i
had an illegal value. If , is exactly zero, and the solution has not been computed. The factorization has not been completed unless .
info
= i
U
i
, i
i
= n