naginterfaces.library.lapacklin.zptrfs¶
- naginterfaces.library.lapacklin.zptrfs(uplo, n, nrhs, d, e, df, ef, b, x)[source]¶
zptrfs
computes error bounds and refines the solution to a complex system of linear equations , where is an Hermitian positive definite tridiagonal matrix and and are matrices, using the modified Cholesky factorization returned byzpttrf()
and an initial solution returned byzpttrs()
. Iterative refinement is used to reduce the backward error as much as possible.For full information please refer to the NAG Library document for f07jv
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f07/f07jvf.html
- Parameters
- uplostr, length 1
Specifies the form of the factorization as follows:
.
.
- nint
, the order of the matrix .
- 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 .
- ecomplex, array-like, shape
If , must contain the superdiagonal elements of the matrix .
If , 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 .
- efcomplex, array-like, shape
If , must contain the superdiagonal elements of the unit upper bidiagonal matrix from the factorization of .
If , must contain the subdiagonal elements of the unit lower bidiagonal matrix from the factorization of .
- bcomplex, array-like, shape
The matrix of right-hand sides .
- xcomplex, array-like, shape
The initial solution matrix .
- Returns
- xcomplex, 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: or .
- (errno )
On entry, error in parameter .
Constraint: .
- (errno )
On entry, error in parameter .
Constraint: .
- Notes
zptrfs
should normally be preceded by calls tozpttrf()
andzpttrs()
.zpttrf()
computes a modified Cholesky factorization of the matrix aswhere is a unit lower bidiagonal matrix and is a diagonal matrix, with positive diagonal elements.
zpttrs()
then utilizes the factorization to compute a solution, , to the required equations. Letting denote a column of ,zptrfs
computes a component-wise backward error, , the smallest relative perturbation in each element of and such that is the exact solution of a perturbed systemThe 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