# naginterfaces.library.lapacklin.dpstrf¶

naginterfaces.library.lapacklin.dpstrf(uplo, n, a, tol=- 1)[source]

dpstrf computes the Cholesky factorization with complete pivoting of a real symmetric positive semidefinite matrix.

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

https://www.nag.com/numeric/nl/nagdoc_29/flhtml/f07/f07kdf.html

Parameters
uplostr, length 1

Specifies whether the upper or lower triangular part of is stored and how is to be factorized.

The upper triangular part of is stored and is factorized as , where is upper triangular.

The lower triangular part of is stored and is factorized as , where is lower triangular.

nint

, the order of the matrix .

afloat, array-like, shape

The symmetric positive semidefinite matrix .

tolfloat, optional

User defined tolerance. If , will be used. The algorithm terminates at the th step if the th step pivot .

Returns
afloat, ndarray, shape

If , the first rows of the upper triangle of are overwritten with the nonzero elements of the Cholesky factor , and the remaining rows of the triangle are destroyed.

If , the first columns of the lower triangle of are overwritten with the nonzero elements of the Cholesky factor , and the remaining columns of the triangle are destroyed.

pivint, ndarray, shape

is such that the nonzero entries of are , for .

rankint

The computed rank of given by the number of steps the algorithm completed.

Raises
NagValueError
(errno )

On entry, error in parameter .

Constraint: or .

(errno )

On entry, error in parameter .

Constraint: .

Warns
NagAlgorithmicWarning
(errno )

The matrix is not positive definite. It is either positive semidefinite with computed rank as returned in and less than , or it may be indefinite, see Further Comments.

Notes

dpstrf forms the Cholesky factorization of a real symmetric positive semidefinite matrix either as if or if , where is a permutation matrix, is an upper triangular matrix and is lower triangular.

This algorithm does not attempt to check that is positive semidefinite.

References

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

Lucas, C, 2004, LAPACK-style codes for Level 2 and 3 pivoted Cholesky factorizations, LAPACK Working Note No. 161. Technical Report CS-04-522, Department of Computer Science, University of Tennessee, 107 Ayres Hall, Knoxville, TN 37996-1301, USA, https://www.netlib.org/lapack/lawnspdf/lawn161.pdf