PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zhbtrd (f08hs)
Purpose
nag_lapack_zhbtrd (f08hs) reduces a complex Hermitian band matrix to tridiagonal form.
Syntax
[
ab,
d,
e,
q,
info] = f08hs(
vect,
uplo,
kd,
ab,
q, 'n',
n)
[
ab,
d,
e,
q,
info] = nag_lapack_zhbtrd(
vect,
uplo,
kd,
ab,
q, 'n',
n)
Description
nag_lapack_zhbtrd (f08hs) reduces a Hermitian band matrix
to real symmetric tridiagonal form
by a unitary similarity transformation:
The unitary matrix is determined as a product of Givens rotation matrices, and may be formed explicitly by the function if required.
The function uses a vectorizable form of the reduction, due to
Kaufman (1984).
References
Kaufman L (1984) Banded eigenvalue solvers on vector machines ACM Trans. Math. Software 10 73–86
Parlett B N (1998) The Symmetric Eigenvalue Problem SIAM, Philadelphia
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates whether
is to be returned.
- is returned.
- is updated (and the array q must contain a matrix on entry).
- is not required.
Constraint:
, or .
- 2:
– 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 .
- 3:
– int64int32nag_int scalar
-
If
, the number of superdiagonals,
, of the matrix
.
If , the number of subdiagonals, , of the matrix .
Constraint:
.
- 4:
– complex array
-
The first dimension of the array
ab must be at least
.
The second dimension of the array
ab must be at least
.
The upper or lower triangle of the
by
Hermitian band matrix
.
The matrix is stored in rows
to
, more precisely,
- if , the elements of the upper triangle of within the band must be stored with element in ;
- if , the elements of the lower triangle of within the band must be stored with element in
- 5:
– complex array
-
The first dimension,
, of the array
q must satisfy
- if or , ;
- if , .
The second dimension of the array
q must be at least
if
or
and at least
if
.
If
,
q must contain the matrix formed in a previous stage of the reduction (for example, the reduction of a banded Hermitian-definite generalized eigenproblem); otherwise
q need not be set.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
ab and the second dimension of the array
ab. (An error is raised if these dimensions are not equal.)
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– complex array
-
The first dimension of the array
ab will be
.
The second dimension of the array
ab will be
.
ab stores values generated during the reduction to tridiagonal form.
The first superdiagonal or subdiagonal and the diagonal of the tridiagonal matrix
are returned in
ab using the same storage format as described above.
- 2:
– double array
-
The diagonal elements of the tridiagonal matrix .
- 3:
– double array
-
The off-diagonal elements of the tridiagonal matrix .
- 4:
– complex array
-
The first dimension,
, of the array
q will be
- if or , ;
- if , .
The second dimension of the array
q will be
if
or
and at least
if
.
If
or
, the
by
matrix
.
If
,
q is not referenced.
- 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:
vect, 2:
uplo, 3:
n, 4:
kd, 5:
ab, 6:
ldab, 7:
d, 8:
e, 9:
q, 10:
ldq, 11:
work, 12:
info.
It is possible that
info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
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.
The computed matrix
differs from an exactly unitary matrix by a matrix
such that
where
is the
machine precision.
Further Comments
The total number of real floating-point operations is approximately if with additional operations if .
The real analogue of this function is
nag_lapack_dsbtrd (f08he).
Example
This example computes all the eigenvalues and eigenvectors of the matrix
, where
Here
is Hermitian and is treated as a band matrix. The program first calls
nag_lapack_zhbtrd (f08hs) to reduce
to tridiagonal form
, and to form the unitary matrix
; the results are then passed to
nag_lapack_zsteqr (f08js) which computes the eigenvalues and eigenvectors of
.
Open in the MATLAB editor:
f08hs_example
function f08hs_example
fprintf('f08hs example results\n\n');
uplo = 'L';
kd = int64(2);
n = 4;
ab = [-3.13 + 0i, -1.91 + 0i, -2.87 + 0i, 0.5 + 0i;
1.94 + 2.10i, -0.82 + 0.89i, -2.10 + 0.16i, 0 + 0i;
-3.40 - 0.25i, -0.67 - 0.34i, 0 + 0i, 0 + 0i];
vect = 'V';
q = complex(zeros(n, n));
[abf, d, e, q, info] = f08hs( ...
vect, uplo, kd, ab, q);
compz = 'V';
[w, ~, z, info] = f08js( ...
compz, d, e, q);
for i = 1:n
[~,k] = max(abs(real(z(:,i)))+abs(imag(z(:,i))));
z(:,i) = z(:,i)*conj(z(k,i))/abs(z(k,i));
end
disp('Eigenvalues');
disp(w');
[ifail] = x04da( ...
'General', ' ', z, 'Eigenvectors');
f08hs example results
Eigenvalues
-7.0042 -4.0038 0.5968 3.0012
Eigenvectors
1 2 3 4
1 0.7293 -0.2128 -0.3354 0.4732
0.0000 0.1511 -0.1604 0.1947
2 -0.1654 0.7316 -0.2804 0.0891
-0.2046 0.0000 -0.3413 0.4387
3 0.6081 0.3910 -0.0144 -0.5172
0.0301 -0.3843 0.1532 -0.1938
4 0.1653 0.2775 0.8019 0.4824
-0.0303 -0.1378 0.0000 0.0000
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015