naginterfaces.library.lapacklin.dptsvx

naginterfaces.library.lapacklin.dptsvx(fact, nrhs, d, e, df, ef, b)[source]

dptsvx uses the factorization

to compute the solution to a real system of linear equations

where is an symmetric positive definite tridiagonal matrix and and are matrices. Error bounds on the solution and a condition estimate are also provided.

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

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

Parameters
factstr, length 1

Specifies whether or not the factorized form of the matrix has been supplied.

and contain the factorized form of the matrix . and will not be modified.

The matrix will be copied to and and factorized.

nrhsint

, the number of right-hand sides, i.e., the number of columns of the matrix .

dfloat, array-like, shape

The diagonal elements of the tridiagonal matrix .

efloat, array-like, shape

The subdiagonal elements of the tridiagonal matrix .

dffloat, array-like, shape

If , must contain the diagonal elements of the diagonal matrix from the factorization of .

effloat, array-like, shape

If , must contain the subdiagonal elements of the unit bidiagonal factor from the factorization of .

bfloat, array-like, shape

The right-hand side matrix .

Returns
dffloat, ndarray, shape

If , contains the diagonal elements of the diagonal matrix from the factorization of .

effloat, ndarray, shape

If , contains the subdiagonal elements of the unit bidiagonal factor from the factorization of .

xfloat, ndarray, shape

If the function exits successfully or = + 1, the solution matrix .

rcondfloat

The reciprocal condition number of the matrix . If is less than the machine precision (in particular, if ), the matrix is singular to working precision. This condition is indicated by a return code of = + 1.

ferrfloat, ndarray, shape

The forward error bound for each solution vector (the th column of the solution matrix ). If is the true solution corresponding to , is an estimated upper bound for the magnitude of the largest element in () divided by the magnitude of the largest element in .

berrfloat, ndarray, shape

The component-wise relative backward error of each solution vector (i.e., the smallest relative change in any element of or that makes an exact solution).

Raises
NagValueError
(errno )

On entry, error in parameter .

Constraint: or .

(errno )

On entry, error in parameter .

Constraint: .

(errno )

On entry, error in parameter .

Constraint: .

(errno )

The leading minor of order of is not positive definite, so the factorization could not be completed, and the solution has not been computed. is returned.

Warns
NagAlgorithmicWarning
(errno )

is nonsingular, but is less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value of would suggest.

Notes

dptsvx performs the following steps:

  1. If , the matrix is factorized as , where is a unit lower bidiagonal matrix and is diagonal. The factorization can also be regarded as having the form .

  2. If the leading principal minor is not positive definite, then the function returns with . Otherwise, the factored form of is used to estimate the condition number of the matrix . If the reciprocal of the condition number is less than machine precision, = + 1 is returned as a warning, but the function still goes on to solve for and compute error bounds as described below.

  3. The system of equations is solved for using the factored form of .

  4. Iterative refinement is applied to improve the computed solution matrix and to calculate error bounds and backward error estimates for it.

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

Higham, N J, 2002, Accuracy and Stability of Numerical Algorithms, (2nd Edition), SIAM, Philadelphia