Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_lapack_zpttrf (f07jr)

## Purpose

nag_lapack_zpttrf (f07jr) computes the modified Cholesky factorization of a complex n $n$ by n $n$ Hermitian positive definite tridiagonal matrix A $A$.

## Syntax

[d, e, info] = f07jr(d, e, 'n', n)
[d, e, info] = nag_lapack_zpttrf(d, e, 'n', n)

## Description

nag_lapack_zpttrf (f07jr) factorizes the matrix A $A$ as
 A = LDLH , $A=LDLH ,$
where L $L$ is a unit lower bidiagonal matrix and D $D$ is a diagonal matrix with positive diagonal elements. The factorization may also be regarded as having the form UHDU ${U}^{\mathrm{H}}DU$, where U $U$ is a unit upper bidiagonal matrix.

None.

## Parameters

### Compulsory Input Parameters

1:     d( : $:$) – double array
Note: the dimension of the array d must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
Must contain the n$n$ diagonal elements of the matrix A$A$.
2:     e( : $:$) – complex array
Note: the dimension of the array e must be at least max (1,n1)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$.
Must contain the (n1)$\left(n-1\right)$ subdiagonal elements of the matrix A$A$.

### Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The dimension of the array d.
n$n$, the order of the matrix A$A$.
Constraint: n0${\mathbf{n}}\ge 0$.

None.

### Output Parameters

1:     d( : $:$) – double array
Note: the dimension of the array d must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
Stores the n$n$ diagonal elements of the diagonal matrix D$D$ from the LDLH$LD{L}^{\mathrm{H}}$ factorization of A$A$.
2:     e( : $:$) – complex array
Note: the dimension of the array e must be at least max (1,n1)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$.
Stores the (n1)$\left(n-1\right)$ subdiagonal elements of the lower bidiagonal matrix L$L$. (e can also be regarded as containing the (n1)$\left(n-1\right)$ superdiagonal elements of the upper bidiagonal matrix U$U$.)
3:     info – int64int32nag_int scalar
info = 0${\mathbf{info}}=0$ unless the function detects an error (see Section [Error Indicators and Warnings]).

## Error Indicators and Warnings

info = i${\mathbf{info}}=-i$
If info = i${\mathbf{info}}=-i$, parameter i$i$ had an illegal value on entry. The parameters are numbered as follows:
1: n, 2: d, 3: e, 4: info.
INFO > 0${\mathbf{INFO}}>0$
If info = i${\mathbf{info}}=i$, the leading minor of order i$i$ is not positive definite. If i < n$i<{\mathbf{n}}$, the factorization could not be completed, while if i = n$i={\mathbf{n}}$, the factorization was completed, but d(n)0${\mathbf{d}}\left({\mathbf{n}}\right)\le 0$.

## Accuracy

The computed factorization satisfies an equation of the form
 A + E = LDLH , $A+E=LDLH ,$
where
 ‖E‖∞ = O(ε)‖A‖∞ $‖E‖∞=O(ε)‖A‖∞$
and ε $\epsilon$ is the machine precision.
Following the use of this function, nag_lapack_zpttrs (f07js) can be used to solve systems of equations AX = B $AX=B$, and nag_lapack_zptcon (f07ju) can be used to estimate the condition number of A $A$.

The total number of floating point operations required to factorize the matrix A $A$ is proportional to n $n$.
The real analogue of this function is nag_lapack_dpttrf (f07jd).

## Example

```function nag_lapack_zpttrf_example
d = [16;
41;
46;
21];
e = [ 16 + 16i;
18 - 9i;
1 - 4i];
[dOut, eOut, info] = nag_lapack_zpttrf(d, e)
```
```

dOut =

16
9
1
4

eOut =

1.0000 + 1.0000i
2.0000 - 1.0000i
1.0000 - 4.0000i

info =

0

```
```function f07jr_example
d = [16;
41;
46;
21];
e = [ 16 + 16i;
18 - 9i;
1 - 4i];
[dOut, eOut, info] = f07jr(d, e)
```
```

dOut =

16
9
1
4

eOut =

1.0000 + 1.0000i
2.0000 - 1.0000i
1.0000 - 4.0000i

info =

0

```