Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 10/31/2024
Public
Document Table of Contents

?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 X the system of linear equations A*X = B, where 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 AT*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 of A, the number of rows in B; n 0.

nrhs

The number of right-hand sides, the number of columns in B; nrhs 0.

dl

The array dl (size n - 1) contains the (n - 1) subdiagonal elements of A.

d

The array d (size n) contains the diagonal elements of A.

du

The array du (size n - 1) contains the (n - 1) superdiagonal elements of A.

b

The array of size max(1, ldb*nrhs) for column major layout and max(1, ldb*n) for row major layout contains the matrix B whose columns are the right-hand sides for the systems of equations.

ldb

The leading dimension of b; ldb max(1, n) for column major layout and ldbnrhs for row major layout.

Output Parameters

dl

Overwritten by the (n-2) elements of the second superdiagonal of the upper triangular matrix U from the LU factorization of A. These elements are stored in dl[0], ..., dl[n - 3].

d

Overwritten by the n diagonal elements of U.

du

Overwritten by the (n-1) elements of the first superdiagonal of U.

b

Overwritten by the solution matrix X.

Return Values

This function returns a value info.

If info = 0, the execution is successful.

If info = -i, parameter i had an illegal value.

If info = i, Ui, i is exactly zero, and the solution has not been computed. The factorization has not been completed unless i = n.