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_ddisna (f08fl)

## Purpose

nag_lapack_ddisna (f08fl) computes the reciprocal condition numbers for the eigenvectors of a real symmetric or complex Hermitian $m$ by $m$ matrix $A$, or for the left or right singular vectors of a general $m$ by $n$ matrix $A$.

## Syntax

[sep, info] = f08fl(job, m, n, d)
[sep, info] = nag_lapack_ddisna(job, m, n, d)

## Description

The bound on the error, measured by the angle in radians, for the $i$th computed vector is given by $\epsilon {‖A‖}_{2}/{\mathrm{sep}}_{i}$, where $\epsilon$ is the machine precision and ${\mathrm{sep}}_{i}$ is the reciprocal condition number for the vectors, returned in the array element ${\mathbf{sep}}\left(i\right)$. ${\mathbf{sep}}\left(i\right)$ is restricted to be at least $\epsilon {‖A‖}_{2}$ in order to limit the size of the error bound.

## References

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

## Parameters

### Compulsory Input Parameters

1:     $\mathrm{job}$ – string (length ≥ 1)
Specifies for which problem the reciprocal condition number should be computed.
${\mathbf{job}}=\text{'E'}$
The eigenvectors of a symmetric or Hermitian matrix.
${\mathbf{job}}=\text{'L'}$
The left singular vectors of a general matrix.
${\mathbf{job}}=\text{'R'}$
The right singular vectors of a general matrix.
Constraint: ${\mathbf{job}}=\text{'E'}$, $\text{'L'}$ or $\text{'R'}$.
2:     $\mathrm{m}$int64int32nag_int scalar
$m$, the number of rows of the matrix $A$.
Constraint: ${\mathbf{m}}\ge 0$.
3:     $\mathrm{n}$int64int32nag_int scalar
$n$, the number of columns of the matrix when ${\mathbf{job}}=\text{'L'}$ or $\text{'R'}$.
If ${\mathbf{job}}=\text{'E'}$, n is not referenced.
Constraint: if ${\mathbf{job}}=\text{'L'}$ or $\text{'R'}$, ${\mathbf{n}}\ge 0$.
4:     $\mathrm{d}\left(:\right)$ – double array
The dimension of the array d must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$ if ${\mathbf{job}}=\text{'E'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{m}},{\mathbf{n}}\right)\right)$ if ${\mathbf{job}}=\text{'L'}$ or $\text{'R'}$
The eigenvalues if ${\mathbf{job}}=\text{'E'}$, or singular values if ${\mathbf{job}}=\text{'L'}$ or $\text{'R'}$ of the matrix $A$.
Constraints:
• the elements of the array d must be in either increasing or decreasing order;
• if ${\mathbf{job}}=\text{'L'}$ or $\text{'R'}$ the elements of d must be non-negative.

None.

### Output Parameters

1:     $\mathrm{sep}\left(:\right)$ – double array
The dimension of the array sep will be $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$ if ${\mathbf{job}}=\text{'E'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{m}},{\mathbf{n}}\right)\right)$ if ${\mathbf{job}}=\text{'L'}$ or $\text{'R'}$
The reciprocal condition numbers of the vectors.
2:     $\mathrm{info}$int64int32nag_int scalar
${\mathbf{info}}=0$ unless the function detects an error (see Error Indicators and Warnings).

## Error Indicators and Warnings

${\mathbf{info}}=-i$
If ${\mathbf{info}}=-i$, parameter $i$ had an illegal value on entry. The parameters are numbered as follows:
1: job, 2: m, 3: n, 4: d, 5: sep, 6: info.

## Accuracy

The reciprocal condition numbers are computed to machine precision relative to the size of the eigenvalues, or singular values.

nag_lapack_ddisna (f08fl) may also be used towards computing error bounds for the eigenvectors of the generalized symmetric or Hermitian definite eigenproblem. See Golub and Van Loan (1996) for further details on the error bounds.

## Example

The use of nag_lapack_ddisna (f08fl) in computing error bounds for eigenvectors of the symmetric eigenvalue problem is illustrated in Example in nag_lapack_dsyev (f08fa); its use in computing error bounds for singular vectors is illustrated in Example in nag_lapack_dgesvd (f08kb); and its use in computing error bounds for eigenvectors of the generalized symmetric definite eigenvalue problem is illustrated in Example in nag_lapack_dsygv (f08sa).
```function f08fl_example

fprintf('f08fl example results\n\n');

a = [1, 2, 3, 4;
0, 2, 3, 4;
0, 0, 3, 4;
0, 0, 0, 4];
n = int64(size(a,1));

% Eigenvalues and eogenvectors of upper triangular A
jobz = 'Vectors';
uplo = 'Upper';
[v, w, info] = f08fa( ...
jobz, uplo, a);

disp('Eigenvectors');
disp(v);

% Eigenvalue error bound
errbnd = x02aj*max(abs(w(1)),abs(w(end)));
% Eigenvector condition numbers
[rcondz, info] = f08fl( ...
'Eigenvectors', n, n, w);

% Eigenvector error bounds
zerrbd = errbnd./rcondz;

disp('Error estimate for the eigenvalues');
fprintf('%12.1e\n',errbnd);
disp('Error estimates for the eigenvectors');
fprintf('%12.1e',zerrbd);
fprintf('\n');

```
```f08fl example results

Eigenvectors
0.7003   -0.5144    0.2767    0.4103
0.3592    0.4851   -0.6634    0.4422
-0.1569    0.5420    0.6504    0.5085
-0.5965   -0.4543   -0.2457    0.6144

Error estimate for the eigenvalues
1.4e-15
Error estimates for the eigenvectors
9.3e-16     6.5e-15     6.5e-15     1.1e-16
```