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_dpttrf (f07jd)

## Purpose

nag_lapack_dpttrf (f07jd) computes the modified Cholesky factorization of a real n $n$ by n $n$ symmetric positive definite tridiagonal matrix A $A$.

## Syntax

[d, e, info] = f07jd(d, e, 'n', n)
[d, e, info] = nag_lapack_dpttrf(d, e, 'n', n)

## Description

nag_lapack_dpttrf (f07jd) factorizes the matrix A $A$ as
 A = LDLT , $A=LDLT ,$
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 UTDU ${U}^{\mathrm{T}}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( : $:$) – double 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 LDLT$LD{L}^{\mathrm{T}}$ factorization of A$A$.
2:     e( : $:$) – double 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 = LDLT , $A+E=LDLT ,$
where
 ‖E‖∞ = O(ε)‖A‖∞ $‖E‖∞=O(ε)‖A‖∞$
and ε $\epsilon$ is the machine precision.
Following the use of this function, nag_lapack_dpttrs (f07je) can be used to solve systems of equations AX = B $AX=B$, and nag_lapack_dptcon (f07jg) 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 complex analogue of this function is nag_lapack_zpttrf (f07jr).

## Example

```function nag_lapack_dpttrf_example
d = [4;
10;
29;
25;
5];
e = [-2;
-6;
15;
8];
[dOut, eOut, info] = nag_lapack_dpttrf(d, e)
```
```

dOut =

4
9
25
16
1

eOut =

-0.5000
-0.6667
0.6000
0.5000

info =

0

```
```function f07jd_example
d = [4;
10;
29;
25;
5];
e = [-2;
-6;
15;
8];
[dOut, eOut, info] = f07jd(d, e)
```
```

dOut =

4
9
25
16
1

eOut =

-0.5000
-0.6667
0.6000
0.5000

info =

0

```

Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013