PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zhptrd (f08gs)
Purpose
nag_lapack_zhptrd (f08gs) reduces a complex Hermitian matrix to tridiagonal form, using packed storage.
Syntax
Description
nag_lapack_zhptrd (f08gs) reduces a complex Hermitian matrix , held in packed storage, to real symmetric tridiagonal form by a unitary similarity transformation: .
The matrix
is not formed explicitly but is represented as a product of
elementary reflectors (see the
F08 Chapter Introduction for details). Functions are provided to work with
in this representation (see
Further Comments).
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
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 .
- 2:
– int64int32nag_int scalar
-
, the order of the matrix .
Constraint:
.
- 3:
– complex array
-
The dimension of the array
ap
must be at least
The upper or lower triangle of the
by
Hermitian 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 .
Optional Input Parameters
None.
Output Parameters
- 1:
– complex array
-
The dimension of the array
ap will be
ap stores the tridiagonal matrix
and details of the unitary matrix
.
- 2:
– double array
-
The diagonal elements of the tridiagonal matrix .
- 3:
– double array
-
The off-diagonal elements of the tridiagonal matrix .
- 4:
– complex array
-
Further details of the unitary matrix .
- 5:
– 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:
uplo, 2:
n, 3:
ap, 4:
d, 5:
e, 6:
tau, 7:
info.
Accuracy
The computed tridiagonal matrix
is exactly similar to a nearby matrix
, where
is a modestly increasing function of
, and
is the
machine precision.
The elements of themselves may be sensitive to small perturbations in or to rounding errors in the computation, but this does not affect the stability of the eigenvalues and eigenvectors.
Further Comments
The total number of real floating-point operations is approximately .
To form the unitary matrix
nag_lapack_zhptrd (f08gs) may be followed by a call to
nag_lapack_zupgtr (f08gt):
[q, info] = f08gt(uplo, n, ap, tau);
To apply
to an
by
complex matrix
nag_lapack_zhptrd (f08gs) may be followed by a call to
nag_lapack_zupmtr (f08gu). For example,
[ap, c, info] = f08gu('Left', uplo, 'No Transpose', ap, tau, c);
forms the matrix product
.
The real analogue of this function is
nag_lapack_dsptrd (f08ge).
Example
This example reduces the matrix
to tridiagonal form, where
using packed storage.
Open in the MATLAB editor:
f08gs_example
function f08gs_example
fprintf('f08gs example results\n\n');
uplo = 'L';
n = int64(4);
ap = [-2.28 + 0i; 1.78 + 2.03i; 2.26 - 0.10i; -0.12 - 2.53i;
-1.12 + 0i; 0.01 - 0.43i; -1.07 - 0.86i;
-0.37 + 0i; 2.31 + 0.92i;
-0.73 + 0i];
[apf, d, e, tau, info] = f08gs( ...
uplo, n, ap);
fprintf('Diagonal and off-diagonal elements of tridiagonal form\n\n');
fprintf(' i d e\n');
for j = 1:n-1
fprintf('%5d%12.5f%12.5f\n', j, d(j), abs(e(j)));
end
fprintf('%5d%12.5f\n', n, d(n));
f08gs example results
Diagonal and off-diagonal elements of tridiagonal form
i d e
1 -2.28000 4.33846
2 -0.12846 2.02259
3 -0.16659 1.80232
4 -1.92495
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015