NAG CL Interface
f01mdc (real_​modified_​cholesky)

Settings help

CL Name Style:


1 Purpose

f01mdc computes the Cheng–Higham modified Cholesky factorization of a real symmetric matrix.

2 Specification

#include <nag.h>
void  f01mdc (Nag_UploType uplo, Integer n, double a[], Integer pda, double offdiag[], Integer ipiv[], double delta, NagError *fail)
The function may be called by the names: f01mdc or nag_matop_real_modified_cholesky.

3 Description

Given a symmetric, possibly indefinite matrix A, f01mdc finds the Cheng–Higham modified Cholesky factorization
PT(A+E)P=LDLT ,  
when uplo=Nag_Lower. Here L is a unit lower triangular matrix, P is a permutation matrix, D is a symmetric block diagonal matrix (with blocks of order 1 or 2) with minimum eigenvalue δ, and E is a perturbation matrix of small norm chosen so that such a factorization can be found. Note that E is not computed explicitly.
If uplo=Nag_Upper, we compute the factorization PT(A+E)P=UDUT, where U is a unit upper triangular matrix.
If the matrix A is symmetric positive definite, the algorithm ensures that E=0. The function f01mec can be used to compute the matrix A+E.

4 References

Ashcraft C, Grimes R G, and Lewis J G (1998) Accurate symmetric indefinite linear equation solvers SIAM J. Matrix Anal. Appl. 20 513–561
Cheng S H and Higham N J (1998) A modified Cholesky algorithm based on a symmetric indefinite factorization SIAM J. Matrix Anal. Appl. 19(4) 1097–1110

5 Arguments

1: uplo Nag_UploType Input
On entry: specifies whether the upper or lower triangular part of A is stored and how A is to be factorized.
uplo=Nag_Upper
The upper triangular part of A is stored and we compute PT(A+E)P=UDUT.
uplo=Nag_Lower
The lower triangular part of A is stored and we compute PT(A+E)P=LDLT.
Constraint: uplo=Nag_Upper or Nag_Lower.
2: n Integer Input
On entry: n, the order of the matrix A.
Constraint: n>0.
3: a[dim] double Input/Output
Note: the dimension, dim, of the array a must be at least max(1,pda×n).
On entry: the n×n symmetric matrix A.
Aij is stored in a[(j-1)×pda+i-1].
If uplo=Nag_Upper, the upper triangular part of A must be stored and the elements of the array below the diagonal are not referenced.
If uplo=Nag_Lower, the lower triangular part of A must be stored and the elements of the array above the diagonal are not referenced.
On exit: a is overwritten.
Aij is stored in a[(j-1)×pda+i-1].
See Section 9 for further details.
4: pda Integer Input
On entry: the stride separating row elements of the matrix A in the array a.
Constraint: pdan.
5: offdiag[n] double Output
On exit: the offdiagonals of the symmetric matrix D are returned in offdiag[0], offdiag[1],, offdiag[n-2] , for uplo=Nag_Lower and in offdiag[1], offdiag[2],, offdiag[n-1], for uplo=Nag_Upper. See Section 9 for further details.
6: ipiv[n] Integer Output
On exit: gives the permutation information of the factorization. The entries of ipiv are either positive, indicating a 1×1 pivot block, or pairs of negative entries, indicating a 2×2 pivot block.
ipiv[i-1]=k>0
The ith and kth rows and columns of A were interchanged and dii is a 1×1 block.
ipiv[i-1]=-k<0 and ipiv[i]=-<0
The ith and kth rows and columns, and the i+1st and th rows and columns, were interchanged and D has the 2×2 block:
( dii di+1,i di+1,i di+1,i+1 )  
  • If uplo=Nag_Upper, di+1,i is stored in offdiag[i]. The interchanges were made in the order i=n,n-1,,2.
  • If uplo=Nag_Lower, di+1,i is stored in offdiag[i-1]. The interchanges were made in the order i=1,2,,n-1.
7: delta double Input
On entry: the value of δ.
Constraint: delta0.0.
8: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_EIGENPROBLEM
An intermediate eigenproblem could not be solved. This should not occur. Please contact NAG with details of your call.
NE_INT
On entry, n=value.
Constraint: n>0.
NE_INT_2
On entry, pda=value and n=value.
Constraint: pdan.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_REAL
On entry, delta=value.
Constraint: delta0.0.

7 Accuracy

If uplo=Nag_Lower, the computed factors L and D are the exact factors not of PT(A+E)P but of P(A+E+F)PT, where
F2 c(n) ε A+E2 c(n) ε L2 D2 LT2 ,  
c(n) is a modest linear function of n, and ε is the machine precision.
If uplo=Nag_Upper, a similar statement holds for the computed factors U and D.

8 Parallelism and Performance

f01mdc is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f01mdc makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

The elements of the main diagonal of D overwrite the corresponding elements of the main diagonal of A; the n-1 elements of the subdiagonal (and superdiagonal, by symmetry) elements of D are stored in the array offdiag. If uplo=Nag_Lower, then these are stored in offdiag[0],,offdiag[n-2] that is di+1,i, for i=1,,n-1 is stored in offdiag[i-1]; otherwise, they are stored in offdiag[1],,offdiag[n-1], with di+1,i stored in offdiag(i+1)-1.
The unit diagonal elements of U or L are not stored. The remaining elements of U or L are stored explicitly in either the strictly upper or strictly lower triangular part of the array a, respectively.
The total number of floating-point operations is approximately 13n3. The searching overhead for rook pivoting used by the algorithm is between O(n2) and O(n3) comparisons. Experimental evidence suggests O(n2) comparisons are usual, see Ashcraft et al. (1998).
All of the entries of the triangular matrix L or U are bounded above (by approximately 2.78), and, therefore, the norm of the matrix itself is also bounded.
The exact size of the perturbation matrix E cannot be predicted a priori. However, the algorithm attempts to ensure that it is not much greater than the minimum perturbation ΔA such that A+ΔA has the minimum eigenvalue δ. In particular, it should be zero when A is positive definite and δ=0. If uplo=Nag_Lower, then in general it can be shown that
E2 λmax(LLT) (δ- λmin(A) λmin(LLT) ) ,  
where λmax and λmin denote the largest and smallest eigenvalues of the matrix in question. A similar result holds if uplo=Nag_Upper.

10 Example

This example computes the modified Cholesky factorization A+E=PLDLTPT, for the indefinite matrix A, where
A= ( 0.9649 0.1419 0.0357 0.3922 0.0462 0.1419 0.4218 0.8491 0.6555 0.0971 0.0357 0.8491 0.9340 0.1712 0.8235 0.3922 0.6555 0.1712 0.7060 0.6948 0.0462 0.0971 0.8235 0.6948 0.3171 ) .  
The output is then passed to f01mec to explicitly form the matrix A+E and the norm of E is computed.

10.1 Program Text

Program Text (f01mdce.c)

10.2 Program Data

Program Data (f01mdce.d)

10.3 Program Results

Program Results (f01mdce.r)