NAG CPP Interface
nagcpp::lapackeig::dsyevd (f08fc)

Settings help

CPP Name Style:



1 Purpose

dsyevd computes all the eigenvalues and, optionally, all the eigenvectors of a real symmetric matrix. If the eigenvectors are requested, then it uses a divide-and-conquer algorithm to compute eigenvalues and eigenvectors. However, if only eigenvalues are required, then it uses the Pal–Walker–Kahan variant of the QL or QR algorithm.

2 Specification

#include "f08/nagcpp_f08fc.hpp"
template <typename A, typename W>

void function dsyevd(const string job, const string uplo, A &&a, W &&w, OptionalF08FC opt)
template <typename A, typename W>

void function dsyevd(const string job, const string uplo, A &&a, W &&w)

3 Description

dsyevd computes all the eigenvalues and, optionally, all the eigenvectors of a real symmetric matrix A. In other words, it can compute the spectral factorization of A as
A=ZΛZT,  
where Λ is a diagonal matrix whose diagonal elements are the eigenvalues λi, and Z is the orthogonal matrix whose columns are the eigenvectors zi. Thus
Azi=λizi,  i=1,2,,n.  

4 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 https://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

5 Arguments

1: job string Input
On entry: indicates whether eigenvectors are computed.
job='N'
Only eigenvalues are computed.
job='V'
Eigenvalues and eigenvectors are computed.
Constraint: job='N' or 'V'.
2: uplo string Input
On entry: indicates whether the upper or lower triangular part of A is stored.
uplo='U'
The upper triangular part of A is stored.
uplo='L'
The lower triangular part of A is stored.
Constraint: uplo='U' or 'L'.
3: a(n,n) double array Input/Output
On entry: the n×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 job='V', a is overwritten by the orthogonal matrix Z which contains the eigenvectors of A.
4: w(n) double array Output
On exit: the eigenvalues of the matrix A in ascending order.
5: opt OptionalF08FC Input/Output
Optional parameter container, derived from Optional.

5.1Additional Quantities

1: n
n, the order of the matrix A
2: info

6 Exceptions and Warnings

All errors and warnings have an associated numeric error code field, errorid, stored either as a member of the thrown exception object (see errorid), or as a member of opt.ifail, depending on how errors and warnings are being handled (see Error Handling for more details).
Raises: ErrorException
errorid=−1
On entry, error in parameter job.
Constraint: job = "N"​ or ​"V".
errorid=−2
On entry, error in parameter uplo.
Constraint: uplo = "U"​ or ​"L".
errorid=−3
On entry, error in parameter n.
Constraint: n0.
errorid>0
If info = value and job = "N", the algorithm failed to
converge; value elements of an intermediate tridiagonal
form did not converge to zero; if info = value and
job = "V", then the algorithm failed to compute an eigenvalue while working
on the submatrix lying in rows and column value/(n+1)
through mod(value,n+1).
errorid=10601
On entry, argument value must be a vector of size value array.
Supplied argument has value dimensions.
errorid=10601
On entry, argument value must be a vector of size value array.
Supplied argument was a vector of size value.
errorid=10601
On entry, argument value must be a vector of size value array.
The size for the supplied array could not be ascertained.
errorid=10601
On entry, argument value must be a value x value array.
Supplied argument has value dimensions.
errorid=10601
On entry, argument value must be a value x value array.
Supplied argument was a value x value array.
errorid=10601
On entry, argument value must be a value x value array.
Not all of the sizes for the supplied array could be ascertained.
errorid=10602
On entry, the raw data component of value is null.
errorid=10603
On entry, unable to ascertain a value for value.
errorid=10604
On entry, the data in value is stored in value Major Order.
The data was expected to be in value Major Order.
errorid=−99
An unexpected error has been triggered by this routine.
errorid=−999
Dynamic memory allocation failed.

7 Accuracy

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

8 Parallelism and Performance

Please see the description for the underlying computational routine in this section of the FL Interface documentation.

9 Further Comments

The complex analogue of this function is f08fqf (no CPP interface).

10 Example

Examples for the NAG CPP Interface are not currently available.