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

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_lapack_dsytrd (f08fe)

## Purpose

nag_lapack_dsytrd (f08fe) reduces a real symmetric matrix to tridiagonal form.

## Syntax

[a, d, e, tau, info] = f08fe(uplo, a, 'n', n)
[a, d, e, tau, info] = nag_lapack_dsytrd(uplo, a, 'n', n)

## Description

nag_lapack_dsytrd (f08fe) reduces a real symmetric matrix A$A$ to symmetric tridiagonal form T$T$ by an orthogonal similarity transformation: A = QTQT$A=QT{Q}^{\mathrm{T}}$.
The matrix Q$Q$ is not formed explicitly but is represented as a product of n1$n-1$ elementary reflectors (see the F08 Chapter Introduction for details). Functions are provided to work with Q$Q$ in this representation (see Section [Further Comments]).

## References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

## Parameters

### Compulsory Input Parameters

1:     uplo – string (length ≥ 1)
Indicates whether the upper or lower triangular part of A$A$ is stored.
uplo = 'U'${\mathbf{uplo}}=\text{'U'}$
The upper triangular part of A$A$ is stored.
uplo = 'L'${\mathbf{uplo}}=\text{'L'}$
The lower triangular part of A$A$ is stored.
Constraint: uplo = 'U'${\mathbf{uplo}}=\text{'U'}$ or 'L'$\text{'L'}$.
2:     a(lda, : $:$) – double array
The first dimension of the array a must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The second dimension of the array must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The n$n$ by n$n$ symmetric matrix A$A$.
• If uplo = 'U'${\mathbf{uplo}}=\text{'U'}$, the upper triangular part of a$a$ must be stored and the elements of the array below the diagonal are not referenced.
• If uplo = 'L'${\mathbf{uplo}}=\text{'L'}$, the lower triangular part of a$a$ must be stored and the elements of the array above the diagonal are not referenced.

### Optional Input Parameters

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

lda work lwork

### Output Parameters

1:     a(lda, : $:$) – double array
The first dimension of the array a will be max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The second dimension of the array will be max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
ldamax (1,n)$\mathit{lda}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
a stores the tridiagonal matrix T$T$ and details of the orthogonal matrix Q$Q$ as specified by uplo.
2:     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)$.
The diagonal elements of the tridiagonal matrix T$T$.
3:     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)$.
The off-diagonal elements of the tridiagonal matrix T$T$.
4:     tau( : $:$) – double array
Note: the dimension of the array tau must be at least max (1,n1)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$.
Further details of the orthogonal matrix Q$Q$.
5:     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: uplo, 2: n, 3: a, 4: lda, 5: d, 6: e, 7: tau, 8: work, 9: lwork, 10: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.

## Accuracy

The computed tridiagonal matrix T$T$ is exactly similar to a nearby matrix (A + E)$\left(A+E\right)$, where
 ‖E‖2 ≤ c (n) ε ‖A‖2 , $‖E‖2≤ c (n) ε ‖A‖2 ,$
c(n)$c\left(n\right)$ is a modestly increasing function of n$n$, and ε$\epsilon$ is the machine precision.
The elements of T$T$ themselves may be sensitive to small perturbations in A$A$ or to rounding errors in the computation, but this does not affect the stability of the eigenvalues and eigenvectors.

The total number of floating point operations is approximately (4/3) n3 $\frac{4}{3}{n}^{3}$.
To form the orthogonal matrix Q$Q$ nag_lapack_dsytrd (f08fe) may be followed by a call to nag_lapack_dorgtr (f08ff):
```[a, info] = f08ff(uplo, a, tau);
```
To apply Q$Q$ to an n$n$ by p$p$ real matrix C$C$ nag_lapack_dsytrd (f08fe) may be followed by a call to nag_lapack_dormtr (f08fg). For example,
```[c, info] = f08fg('Left', uplo, 'No Transpose', a, tau, c);
```
forms the matrix product QC$QC$.
The complex analogue of this function is nag_lapack_zhetrd (f08fs).

## Example

```function nag_lapack_dsytrd_example
uplo = 'L';
a = [2.07, 0, 0, 0;
3.87, -0.21, 0, 0;
4.2, 1.87, 1.15, 0;
-1.15, 0.63, 2.06, -1.81];
[aOut, d, e, tau, info] = nag_lapack_dsytrd(uplo, a)
```
```

aOut =

2.0700         0         0         0
-5.8258    1.4741         0         0
0.4332    2.6240   -0.6492         0
-0.1186    0.8063    0.9163   -1.6949

d =

2.0700
1.4741
-0.6492
-1.6949

e =

-5.8258
2.6240
0.9163

tau =

1.6643
1.2120
0

info =

0

```
```function f08fe_example
uplo = 'L';
a = [2.07, 0, 0, 0;
3.87, -0.21, 0, 0;
4.2, 1.87, 1.15, 0;
-1.15, 0.63, 2.06, -1.81];
[aOut, d, e, tau, info] = f08fe(uplo, a)
```
```

aOut =

2.0700         0         0         0
-5.8258    1.4741         0         0
0.4332    2.6240   -0.6492         0
-0.1186    0.8063    0.9163   -1.6949

d =

2.0700
1.4741
-0.6492
-1.6949

e =

-5.8258
2.6240
0.9163

tau =

1.6643
1.2120
0

info =

0

```

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

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