XLPack 6.1
Excel Worksheet Function Numerical Library Reference Manual
Loading...
Searching...
No Matches

◆ WDposv()

Function WDposv ( Uplo As  String,
N As  Long,
A As  Variant,
B As  Variant,
Optional Nrhs As  Long = 1 
)

Solution to system of linear equations AX = B for a symmetric positive definite matrix

Purpose
WDposv 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.
Returns
N+2 x Nrhs
Column 1Column 2. . .Column Nrhs
Rows 1 to NSolution matrix X
Row N+1Reciprocal condition number0. . .0
Row N+2Return code0. . .0

Return code.
= 0: Successful exit.
= i > 0: The i-th diagonal element of the factor is zero. (Matrix A is singular)
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 >= 1)
[in]A(N x N) N x N symmetric positive definite matrix A. Upper or lower triangular part is to be referenced according to Uplo.
[in]B(N x Nrhs) N x Nrhs right hand side matrix B.
[in]Nrhs(Optional)
Number of columns of right hand side matrix B. (Nrhs >= 1) (default = 1)
Reference
LAPACK
Example
Solve the system of linear equations Ax = B and estimate the reciprocal of the condition number (RCond) of A, where A is symmetric positive definite and
( 2.2 -0.11 -0.32 ) ( -1.566 )
A = ( -0.11 2.93 0.81 ), B = ( -2.8425 )
( -0.32 0.81 2.37 ) ( -1.1765 )

WDposv