NAG CPP Interface
nagcpp::lapackeig::dsyevd (f08fc)
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 or 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
.
In other words, it can compute the spectral factorization of
as
where
is a diagonal matrix whose diagonal elements are the eigenvalues
, and
is the orthogonal matrix whose columns are the eigenvectors
. Thus
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:
– string
Input
-
On entry: indicates whether eigenvectors are computed.
- Only eigenvalues are computed.
- Eigenvalues and eigenvectors are computed.
Constraint:
or .
-
2:
– string
Input
-
On entry: indicates whether the upper or lower triangular part of
is stored.
- The upper triangular part of is stored.
- The lower triangular part of is stored.
Constraint:
or .
-
3:
– double array
Input/Output
-
On entry: the
by
symmetric matrix
.
- If , the upper triangular part of must be stored and the elements of the array below the diagonal are not referenced.
- If , the lower triangular part of must be stored and the elements of the array above the diagonal are not referenced.
On exit: if
,
a is overwritten by the orthogonal matrix
which contains the eigenvectors of
.
-
4:
– double array
Output
-
On exit: the eigenvalues of the matrix in ascending order.
-
5:
– OptionalF08FC
Input/Output
-
Optional parameter container, derived from
Optional.
5.1Additional Quantities
- 1:
- , the order of the matrix
- 2:
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
-
- On entry, error in parameter job.
Constraint: .
- On entry, error in parameter uplo.
Constraint: .
- On entry, error in parameter .
Constraint: .
- If and , the algorithm failed to
converge; elements of an intermediate tridiagonal
form did not converge to zero; if and
, then the algorithm failed to compute an eigenvalue while working
on the submatrix lying in rows and column
through .
- On entry, argument must be a vector of size array.
Supplied argument has dimensions.
- On entry, argument must be a vector of size array.
Supplied argument was a vector of size .
- On entry, argument must be a vector of size array.
The size for the supplied array could not be ascertained.
- On entry, argument must be a x array.
Supplied argument has dimensions.
- On entry, argument must be a x array.
Supplied argument was a x array.
- On entry, argument must be a x array.
Not all of the sizes for the supplied array could be ascertained.
- On entry, the raw data component of is null.
- On entry, unable to ascertain a value for .
- On entry, the data in is stored in Major Order.
The data was expected to be in Major Order.
- An unexpected error has been triggered by this routine.
- Dynamic memory allocation failed.
7
Accuracy
The computed eigenvalues and eigenvectors are exact for a nearby matrix
, where
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.
The complex analogue of this function is
f08fqf (no CPP interface).
10
Example
Examples for the NAG CPP Interface are not currently available.