XLPack 6.1
C/C++ API Reference Manual (Basic module)
Loading...
Searching...
No Matches

◆ _dposv()

void _dposv ( char  uplo,
int  n,
int  nrhs,
int  lda,
double  a[],
int  ldb,
double  b[],
int *  info 
)

(Simple driver) Solution to system of linear equations AX = B for a symmetric positive definite matrix

Purpose
This routine computes the solution to a real system of linear equations
A * X = B,
where A is an n x n symmetric positive definite matrix and X and B are n x nrhs matrices.

The Cholesky decomposition is used to factor A as
A = U^T*U, if uplo = 'U', or
A = L*L^T, if uplo = 'L',
where U is an upper triangular matrix and L is a lower triangular matrix. The factored form of A is then used to solve the system of equations A * X = B.
Parameters
[in]uplo= 'U': Upper triangle of A is stored.
= 'L': Lower triangle of A is stored.
[in]nNumber of linear equations, i.e., order of the matrix A. (n >= 0) (If n = 0, returns without computation)
[in]nrhsNumber of right hand sides, i.e., number of columns of the matrix B. (nrhs >= 0) (If nrhs = 0, returns without computation)
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, n))
[in,out]a[][]Array a[la][lda] (la >= n)
[in] n x n symmetric positove definite matrix A. The upper or lower triangular part is to be referenced in accordance with uplo.
[out] If info = 0, the factor U or L from the Cholesky factorization A = U^T*U or A = L*L^T.
[in]ldbLeading dimension of the two dimensional array b[][]. (ldb >= max(1, n))
[in,out]b[][]Array b[lb][ldb] (lb >= nrhs)
[in] n x nrhs right hand side matrix B.
[out] If info = 0, the n x nrhs solution matrix X.
[out]info= 0: Successful exit
= -1: The argument uplo had an illegal value (uplo != 'U' nor 'L')
= -2: The argument n had an illegal value (n < 0)
= -3: The argument nrhs had an illegal value (nrhs < 0)
= -4: The argument lda had an illegal value (lda < max(1, n))
= -6: The argument ldb had an illegal value (ldb < max(1, n))
= i > 0: The leading minor of order i of A is not positive definite, so the factorization could not be completed, and the solution has not been computed.
Reference
LAPACK