# naginterfaces.library.lapacklin.zgttrs¶

naginterfaces.library.lapacklin.zgttrs(trans, dl, d, du, du2, ipiv, b)[source]

zgttrs computes the solution to a complex system of linear equations or or , where is an tridiagonal matrix and and are matrices, using the factorization returned by zgttrf().

For full information please refer to the NAG Library document for f07cs

https://www.nag.com/numeric/nl/nagdoc_27.3/flhtml/f07/f07csf.html

Parameters
transstr, length 1

Specifies the equations to be solved as follows:

Solve for .

Solve for .

Solve for .

dlcomplex, array-like, shape

Must contain the multipliers that define the matrix of the factorization of .

dcomplex, array-like, shape

Must contain the diagonal elements of the upper triangular matrix from the factorization of .

ducomplex, array-like, shape

Must contain the elements of the first superdiagonal of .

du2complex, array-like, shape

Must contain the elements of the second superdiagonal of .

ipivint, array-like, shape

Must contain the pivot indices that define the permutation matrix . At the th step, row of the matrix was interchanged with row , and must always be either or , indicating that a row interchange was not performed.

bcomplex, array-like, shape

The matrix of right-hand sides .

Returns
bcomplex, ndarray, shape

The solution matrix .

Raises
NagValueError
(errno )

On entry, error in parameter .

Constraint: , or .

(errno )

On entry, error in parameter .

Constraint: .

(errno )

On entry, error in parameter .

Constraint: .

Notes

zgttrs should be preceded by a call to zgttrf(), which uses Gaussian elimination with partial pivoting and row interchanges to factorize the matrix as

where is a permutation matrix, is unit lower triangular with at most one nonzero subdiagonal element in each column, and is an upper triangular band matrix, with two superdiagonals. zgttrs then utilizes the factorization to solve the required equations.

References

Anderson, E, Bai, Z, Bischof, C, Blackford, S, Demmel, J, Dongarra, J J, Du Croz, J J, Greenbaum, A, Hammarling, S, McKenney, A and Sorensen, D, 1999, LAPACK Users’ Guide, (3rd Edition), SIAM, Philadelphia, https://www.netlib.org/lapack/lug

Golub, G H and Van Loan, C F, 1996, Matrix Computations, (3rd Edition), Johns Hopkins University Press, Baltimore