|
|
◆ Dpbtrf()
| Sub Dpbtrf |
( |
Uplo As |
String, |
|
|
N As |
Long, |
|
|
Kd As |
Long, |
|
|
Ab() As |
Double, |
|
|
Info As |
Long |
|
) |
| |
Cholesky factorization of a symmetric positive definite band matrix
- Purpose
- This routine computes the Cholesky factorization of a real symmetric positive definite band matrix A. The factorization has the form
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.
- Parameters
-
| [in] | Uplo | = "U": Upper triangle of A is stored.
= "L": Lower triangle of A is stored. |
| [in] | N | Number of linear equations, i.e., order of the matrix A. (N >= 0) (If N = 0, returns without computation) |
| [in] | Kd | Number of super-diagonals of the matrix A if Uplo = "U", or number of sub-diagonals if Uplo = "L". (Kd >= 0) |
| [in,out] | Ab() | Array Ab(LAb1 - 1, LAb2 - 1) (LAb1 >= Kd + 1, LAb2 >= N)
[in] N x N symmetric band matrix A in Kd+1 x N symmetric band matrix form. Upper or lower part is to be stored in accordance with uplo. See below for further details.
[out] If Info = 0, the triangular factor U or L from the Cholesky factorization A = U^T*U or A = L*L^T of the band matrix A, in the same storage format as A. |
| [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 Kd had an illegal value. (Kd < 0)
= -4: The argument Ab() is invalid.
= i > 0: The leading minor of order i of A is not positive definite, so the factorization could not be completed. |
- Further Details
- The symmetric band matrix form is illustrated by the following example, when N = 6, Kd = 2, and Uplo = "U":
On entry:
* * a13 a24 a35 a46
* a12 a23 a34 a45 a56
a11 a22 a33 a44 a55 a66
On exit:
* * u13 u24 u35 u46
* u12 u23 u34 u45 u56
u11 u22 u33 u44 u55 u66
Similarly, if uplo = "L" the format of A is as follows: On entry:
a11 a22 a33 a44 a55 a66
a21 a32 a43 a54 a65 *
a31 a42 a53 a64 * *
On exit:
l11 l22 l33 l44 l55 l66
l21 l32 l43 l54 l65 *
l31 l42 l53 l64 * *
Array elements marked * are not used by the routine.
- Reference
- LAPACK
- Example Program
- Solve the system of linear equations Ax = B and estimate the reciprocal of the condition number (RCond) of A, where A is banded symmetric positive definite and
( 0.61 0.79 0 ) ( 0.3034 )
A = ( 0.79 2.23 0.25 ), B = ( 0.8537 )
( 0 0.25 2.87 ) ( 0.8000 )
Sub Ex_Dpbtrf()
Const N As Long = 3, Kd = 1
Dim Ab(Kd, N - 1) As Double, B(N - 1) As Double
Dim ANorm As Double, RCond As Double, Info As Long
Ab(0, 0) = 0.61: Ab(0, 1) = 2.23: Ab(0, 2) = 2.87
Ab(1, 0) = 0.79: Ab(1, 1) = 0.25
B(0) = 0.3034: B(1) = 0.8537: B(2) = 0.8
ANorm = Dlansb("1", "L", N, Kd, Ab())
Call Dpbtrf("L", N, Kd, Ab(), Info)
If Info = 0 Then Call Dpbtrs("L", N, Kd, Ab(), B(), Info)
If Info = 0 Then Call Dpbcon("L", N, Kd, Ab(), ANorm, RCond, Info)
Debug.Print "X =", B(0), B(1), B(2)
Debug.Print "RCond =", RCond
Debug.Print "Info =", Info
End Sub
Function Dlansb(Norm As String, Uplo As String, N As Long, K As Long, Ab() As Double, Optional Info As Long) As Double One norm, Frobenius norm, infinity norm, or largest absolute value of any element of a symmetric band...
Sub Dpbcon(Uplo As String, N As Long, Kd As Long, Ab() As Double, ANorm As Double, RCond As Double, Info As Long) Condition number of a symmetric positive definite band matrix
Sub Dpbtrf(Uplo As String, N As Long, Kd As Long, Ab() As Double, Info As Long) Cholesky factorization of a symmetric positive definite band matrix
Sub Dpbtrs(Uplo As String, N As Long, Kd As Long, Ab() As Double, B() As Double, Info As Long, Optional Nrhs As Long=1) Solution to factorized system of linear equations AX = B for a symmetric positive definite band matri...
- Example Results
X = 6.99999999999999E-02 0.33 0.25
RCond = 7.20810157140908E-02
Info = 0
|