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


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++
static void f08fa(
	String^ jobz, 
	String^ uplo, 
	int n, 
	array<double,2>^ a, 
	array<double>^ w, 
	[OutAttribute] int% info
static member f08fa : 
        jobz : string * 
        uplo : string * 
        n : int * 
        a : float[,] * 
        w : float[] * 
        info : int byref -> unit 


Type: System..::..String
On entry: indicates whether eigenvectors are computed.
Only eigenvalues are computed.
Eigenvalues and eigenvectors are computed.
Constraint: jobz="N" or "V".
Type: System..::..String
On entry: if uplo="U", the upper triangular part of A is stored.
If uplo="L", the lower triangular part of A is stored.
Constraint: uplo="U" or "L".
Type: System..::..Int32
On entry: n, the order of the matrix A.
Constraint: n0.
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: dim1max1,n
Note: the second dimension of the array a must be at least max1,n.
On entry: the n by n symmetric matrix A.
  • If uplo="U", the upper triangular part of A must be stored and the elements of the array below the diagonal are not referenced.
  • If uplo="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 jobz="V", then a contains the orthonormal eigenvectors of the matrix A.
If jobz="N", then on exit the lower triangle (if uplo="L") or the upper triangle (if uplo="U") of a, including the diagonal, is overwritten.
Type: array<System..::..Double>[]()[][]
An array of size [n]
On exit: the eigenvalues in ascending order.
Type: System..::..Int32%
On exit: info=0 unless the method detects an error (see [Error Indicators and Warnings]).


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.


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.
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.
If info=i, the algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
An error occured, see message report.
Invalid Parameters value
Invalid dimension for array value
Negative dimension for array value
Invalid Parameters value
Invalid Parameters value


The computed eigenvalues and eigenvectors are exact for a nearby matrix A+E, where
and ε is the machine precision. See Section 4.7 of Anderson et al. (1999) for further details.

Parallelism and Performance


Further Comments

The total number of floating-point operations is proportional to n3.
The complex analogue of this method is (F08FNF not in this release).


This example finds all the eigenvalues and eigenvectors of the symmetric matrix
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

See Also