naginterfaces.library.lapacklin.dptrfs

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

dptrfs computes error bounds and refines the solution to a real system of linear equations , where is an symmetric positive definite tridiagonal matrix and and are matrices, using the modified Cholesky factorization returned by dpttrf() and an initial solution returned by dpttrs(). Iterative refinement is used to reduce the backward error as much as possible.

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

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f07/f07jhf.html

Parameters
nrhsint

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

dfloat, array-like, shape

Must contain the diagonal elements of the matrix of .

efloat, array-like, shape

Must contain the subdiagonal elements of the matrix .

dffloat, array-like, shape

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

effloat, array-like, shape

Must contain the subdiagonal elements of the unit bidiagonal matrix from the factorization of .

bfloat, array-like, shape

The matrix of right-hand sides .

xfloat, array-like, shape

The initial solution matrix .

Returns
xfloat, ndarray, shape

The refined solution matrix .

ferrfloat, ndarray, shape

Estimate of the forward error bound for each computed solution vector, such that , where is the th column of the computed solution returned in the array and is the corresponding column of the exact solution . The estimate is almost always a slight overestimate of the true error.

berrfloat, ndarray, shape

Estimate of the component-wise relative backward error of each computed 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: .

(errno )

On entry, error in parameter .

Constraint: .

Notes

dptrfs should normally be preceded by calls to dpttrf() and dpttrs(). dpttrf() computes a modified Cholesky factorization of the matrix as

where is a unit lower bidiagonal matrix and is a diagonal matrix, with positive diagonal elements. dpttrs() then utilizes the factorization to compute a solution, , to the required equations. Letting denote a column of , dptrfs computes a component-wise backward error, , the smallest relative perturbation in each element of and such that is the exact solution of a perturbed system

The function also estimates a bound for the component-wise forward error in the computed solution defined by , where is the corresponding column of the exact solution, .

Note that the modified Cholesky factorization of can also be expressed as

where is unit upper bidiagonal.

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