NAG CL Interface
f01mec (real_​mod_​chol_​perturbed_​a)

Settings help

CL Name Style:


1 Purpose

f01mec computes the positive definite perturbed matrix A+E from the factors of a modified Cholesky factorization of a real symmetric matrix, A.

2 Specification

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

3 Description

f01mec computes the positive definite perturbed matrix A+E from the factors provided by a previous call to f01mdc. For 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). The matrix E is not explicitly formed.
If uplo=Nag_Upper, we compute A+E from the factorization PT(A+E)P=UDUT, where U is a unit upper triangular matrix.

4 References

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: indicates whether the upper or lower triangular part of A was stored and how it was factorized.
uplo=Nag_Upper
The upper triangular part of A was stored and we compute A+E such that PT(A+E)P=UDUT.
uplo=Nag_Lower
The lower triangular part of A was stored and we compute A+E such that 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 modified Cholesky factor of A, as returned by f01mdc.
On exit:
Aij is stored in a[(j-1)×pda+i-1].
If uplo=Nag_Upper, A is upper triangular and the elements of the array below the diagonal are not set.
If uplo=Nag_Lower, A is lower triangular and the elements of the array above the diagonal are not set.
4: pda Integer Input
On entry: the stride separating row elements of the matrix A in the array a.
Constraint: pdan.
5: offdiag[n] const double Input
On entry: the array offdiag as returned by f01mdc.
6: ipiv[n] const Integer Input
On entry: the array ipiv as returned by f01mdc.
7: 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_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.

7 Accuracy

See Section 7 in f01mdc for an indication of the accuracy of the computed factors L, U, and D.

8 Parallelism and Performance

f01mec is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f01mec 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

Arrays are internally allocated by f01mec. The total size of these arrays does not exceed n2 real elements. All allocated memory is freed before return of f01mec.

10 Example

See f01mdc.