PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dspgst (f08te)
Purpose
nag_lapack_dspgst (f08te) reduces a real symmetric-definite generalized eigenproblem
,
or
to the standard form
, where
is a real symmetric matrix and
has been factorized by
nag_lapack_dpptrf (f07gd), using packed storage.
Syntax
Description
To reduce the real symmetric-definite generalized eigenproblem
,
or
to the standard form
using packed storage,
nag_lapack_dspgst (f08te) must be preceded by a call to
nag_lapack_dpptrf (f07gd) which computes the Cholesky factorization of
;
must be positive definite.
The different problem types are specified by the argument
itype, as indicated in the table below. The table shows how
is computed by the function, and also how the eigenvectors
of the original problem can be recovered from the eigenvectors of the standard form.
itype |
Problem |
uplo |
|
|
|
|
|
'U'
'L' |
|
|
|
|
|
'U'
'L' |
|
|
|
|
|
'U'
'L' |
|
|
|
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
Indicates how the standard form is computed.
-
- if , ;
- if , .
- or
-
- if , ;
- if , .
Constraint:
, or .
- 2:
– string (length ≥ 1)
-
Indicates whether the upper or lower triangular part of
is stored and how
has been factorized.
- The upper triangular part of is stored and .
- The lower triangular part of is stored and .
Constraint:
or .
- 3:
– int64int32nag_int scalar
-
, the order of the matrices and .
Constraint:
.
- 4:
– double array
-
The dimension of the array
ap
must be at least
The upper or lower triangle of the
by
symmetric matrix
, packed by columns.
More precisely,
- if , the upper triangle of must be stored with element in for ;
- if , the lower triangle of must be stored with element in for .
- 5:
– double array
-
The dimension of the array
bp
must be at least
The Cholesky factor of
as specified by
uplo and returned by
nag_lapack_dpptrf (f07gd).
Optional Input Parameters
None.
Output Parameters
- 1:
– double array
-
The dimension of the array
ap will be
The upper or lower triangle of
ap stores the corresponding upper or lower triangle of
as specified by
itype and
uplo, using the same packed storage format as described above.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , parameter had an illegal value on entry. The parameters are numbered as follows:
1:
itype, 2:
uplo, 3:
n, 4:
ap, 5:
bp, 6:
info.
Accuracy
Forming the reduced matrix
is a stable procedure. However it involves implicit multiplication by
if (
) or
(if
or
). When
nag_lapack_dspgst (f08te) is used as a step in the computation of eigenvalues and eigenvectors of the original problem, there may be a significant loss of accuracy if
is ill-conditioned with respect to inversion.
See the document for
nag_lapack_dsygv (f08sa) for further details.
Further Comments
The total number of floating-point operations is approximately .
The complex analogue of this function is
nag_lapack_zhpgst (f08ts).
Example
This example computes all the eigenvalues of
, where
using packed storage. Here
is symmetric positive definite and must first be factorized by
nag_lapack_dpptrf (f07gd). The program calls
nag_lapack_dspgst (f08te) to reduce the problem to the standard form
; then
nag_lapack_dsptrd (f08ge) to reduce
to tridiagonal form, and
nag_lapack_dsterf (f08jf) to compute the eigenvalues.
Open in the MATLAB editor:
f08te_example
function f08te_example
fprintf('f08te example results\n\n');
n = int64(4);
uplo = 'L';
ap = [0.24; 0.39; 0.42; -0.16;
-0.11; 0.79; 0.63;
-0.25; 0.48;
-0.03];
bp = [4.16; -3.12; 0.56; -0.10;
5.03; -0.83; 1.09;
0.76; 0.34;
1.18];
[lp, info] = f07gd( ...
uplo, n, bp);
itype = int64(1);
[cp, info] = f08te( ...
itype, uplo, n, ap, lp);
[cpf, d, e, tau, info] = f08ge( ...
uplo, n, cp);
[w, ~, info] = f08jf( ...
d, e);
disp('Eigenvalues');
disp(w');
f08te example results
Eigenvalues
-2.2254 -0.4548 0.1001 1.1270
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015