f08fa computes all the eigenvalues and, optionally, all the eigenvectors of a real $n$ by $n$ symmetric matrix $A$.

Syntax

C#
```public static void f08fa(
string jobz,
string uplo,
int n,
double[,] a,
double[] w,
out int info
)```
Visual Basic
```Public Shared Sub f08fa ( _
jobz As String, _
uplo As String, _
n As Integer, _
a As Double(,), _
w As Double(), _
<OutAttribute> ByRef info As Integer _
)```
Visual C++
```public:
static void f08fa(
String^ jobz,
String^ uplo,
int n,
array<double,2>^ a,
array<double>^ w,
[OutAttribute] int% info
)```
F#
```static member f08fa :
jobz : string *
uplo : string *
n : int *
a : float[,] *
w : float[] *
info : int byref -> unit
```

Parameters

jobz
Type: System..::..String
On entry: indicates whether eigenvectors are computed.
${\mathbf{jobz}}=\text{"N"}$
Only eigenvalues are computed.
${\mathbf{jobz}}=\text{"V"}$
Eigenvalues and eigenvectors are computed.
Constraint: ${\mathbf{jobz}}=\text{"N"}$ or $\text{"V"}$.
uplo
Type: System..::..String
On entry: if ${\mathbf{uplo}}=\text{"U"}$, the upper triangular part of $A$ is stored.
If ${\mathbf{uplo}}=\text{"L"}$, the lower triangular part of $A$ is stored.
Constraint: ${\mathbf{uplo}}=\text{"U"}$ or $\text{"L"}$.
n
Type: System..::..Int32
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
a
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: $\mathrm{dim1}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
Note: the second dimension of the array a must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the $n$ by $n$ symmetric matrix $A$.
• If ${\mathbf{uplo}}=\text{"U"}$, the upper triangular part of $A$ must be stored and the elements of the array below the diagonal are not referenced.
• If ${\mathbf{uplo}}=\text{"L"}$, the lower triangular part of $A$ must be stored and the elements of the array above the diagonal are not referenced.
On exit: if ${\mathbf{jobz}}=\text{"V"}$, then a contains the orthonormal eigenvectors of the matrix $A$.
If ${\mathbf{jobz}}=\text{"N"}$, then on exit the lower triangle (if ${\mathbf{uplo}}=\text{"L"}$) or the upper triangle (if ${\mathbf{uplo}}=\text{"U"}$) of a, including the diagonal, is overwritten.
w
Type: array<System..::..Double>[]()[][]
An array of size [n]
On exit: the eigenvalues in ascending order.
info
Type: System..::..Int32%
On exit: ${\mathbf{info}}=0$ unless the method detects an error (see [Error Indicators and Warnings]).

Description

The symmetric matrix $A$ is first reduced to tridiagonal form, using orthogonal similarity transformations, and then the $QR$ algorithm is applied to the tridiagonal matrix to compute the eigenvalues and (optionally) the eigenvectors.

References

Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Error Indicators and Warnings

Some error messages may refer to parameters that are dropped from this interface (LDA) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
${\mathbf{info}}<0$
If ${\mathbf{info}}=-i$, argument $i$ had an illegal value. An explanatory message is output, and execution of the program is terminated.
${\mathbf{info}}>0$
If ${\mathbf{info}}=i$, the algorithm failed to converge; $i$ off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
${\mathbf{ifail}}=-9000$
An error occured, see message report.
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-4000$
Invalid dimension for array $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-8000$
Negative dimension for array $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$

Accuracy

The computed eigenvalues and eigenvectors are exact for a nearby matrix $\left(A+E\right)$, where
 $E2=OεA2,$
and $\epsilon$ is the machine precision. See Section 4.7 of Anderson et al. (1999) for further details.

Parallelism and Performance

None.

The total number of floating-point operations is proportional to ${n}^{3}$.
The complex analogue of this method is (F08FNF not in this release).

Example

This example finds all the eigenvalues and eigenvectors of the symmetric matrix
 $A=1234223433344444,$
together with approximate error bounds for the computed eigenvalues and eigenvectors.

Example program (C#): f08fae.cs

Example program data: f08fae.d

Example program results: f08fae.r