nag_complex_cholesky (f01bnc) (PDF version)
f01 Chapter Contents
f01 Chapter Introduction
NAG Library Manual

# NAG Library Function Documentnag_complex_cholesky (f01bnc)

## 1  Purpose

nag_complex_cholesky (f01bnc) computes a Cholesky factorization of a complex positive definite Hermitian matrix.

## 2  Specification

 #include #include
 void nag_complex_cholesky (Integer n, Complex a[], Integer tda, double p[], NagError *fail)

## 3  Description

nag_complex_cholesky (f01bnc) computes the Cholesky factorization of a complex positive definite Hermitian matrix $A={U}^{H}U$, where $U$ is a complex upper triangular matrix with real diagonal elements.
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag

## 5  Arguments

1:     nIntegerInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 1$.
2:     a[${\mathbf{n}}×{\mathbf{tda}}$]ComplexInput/Output
On entry: the lower triangle of the $n$ by $n$ positive definite Hermitian matrix $A$. The elements of the array above the diagonal need not be set.
On exit: the off-diagonal elements of the upper triangular matrix $U$. The lower triangle of $A$ is unchanged.
3:     tdaIntegerInput
On entry: the stride separating matrix column elements in the array a.
Constraint: ${\mathbf{tda}}\ge {\mathbf{n}}$.
4:     p[n]doubleOutput
On exit: the reciprocals of the real diagonal elements of $U$.
5:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_2_INT_ARG_LT
On entry, ${\mathbf{tda}}=⟨\mathit{\text{value}}⟩$ while ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$. These arguments must satisfy ${\mathbf{tda}}\ge {\mathbf{n}}$.
NE_DIAG_IMAG_NON_ZERO
Matrix diagonal element ${\mathbf{a}}\left[\left(⟨\mathit{\text{value}}⟩\right)×{\mathbf{tda}}+⟨\mathit{\text{value}}⟩\right]$ has nonzero imaginary part.
NE_INT_ARG_LT
On entry, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{n}}\ge 1$.
NE_NOT_POS_DEF
The matrix is not positive definite, possibly due to rounding errors.

## 7  Accuracy

The Cholesky factorization of a positive definite matrix is known for its remarkable numerical stability. The computed matrix $U$ satisfies the relation ${U}^{H}U=A+E$ where the 2-norms of $A$ and $E$ are related by
 $E ≤ c ε A ,$
$c$ is a modest function of $n$, and $\epsilon$ is the machine precision.

Not applicable.

## 9  Further Comments

The time taken by nag_complex_cholesky (f01bnc) is approximately proportional to ${n}^{3}$.

## 10  Example

To compute the Cholesky factorization of the well-conditioned positive definite Hermitian matrix
 $- 15 -2 1 - 2 i -1 2 1 - 4 + 3 i -1 1 + 2 i - 20 1 - 2 + 2 i -2 3 - 3 i -1 2 2 - 2 - 1 i - 18 1 - 1 + 2 i 1 - 4 - 3 i -2 3 + 3 i 1 - 1 - 2 i - 26 .$

### 10.1  Program Text

Program Text (f01bnce.c)

### 10.2  Program Data

Program Data (f01bnce.d)

### 10.3  Program Results

Program Results (f01bnce.r)

nag_complex_cholesky (f01bnc) (PDF version)
f01 Chapter Contents
f01 Chapter Introduction
NAG Library Manual