PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dsytrd (f08fe)
Purpose
nag_lapack_dsytrd (f08fe) reduces a real symmetric matrix to tridiagonal form.
Syntax
Description
nag_lapack_dsytrd (f08fe) reduces a real symmetric matrix to symmetric tridiagonal form by an orthogonal 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:
– double array
-
The first dimension of the array
a must be at least
.
The second dimension of the array
a must be at least
.
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.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a and the second dimension of the array
a.
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– double array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
a stores the tridiagonal matrix
and details of the orthogonal matrix
as specified by
uplo.
- 2:
– double array
-
The dimension of the array
d will be
The diagonal elements of the tridiagonal matrix .
- 3:
– double array
-
The dimension of the array
e will be
The off-diagonal elements of the tridiagonal matrix .
- 4:
– double array
-
The dimension of the array
tau will be
Further details of the orthogonal 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:
a, 4:
lda, 5:
d, 6:
e, 7:
tau, 8:
work, 9:
lwork, 10:
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.
Further Comments
The total number of floating-point operations is approximately .
To form the orthogonal matrix
nag_lapack_dsytrd (f08fe) may be followed by a call to
nag_lapack_dorgtr (f08ff):
[a, info] = f08ff(uplo, a, tau);
To apply
to an
by
real matrix
nag_lapack_dsytrd (f08fe) may be followed by a call to
nag_lapack_dormtr (f08fg). For example,
[c, info] = f08fg('Left', uplo, 'No Transpose', a, tau, c);
forms the matrix product
.
The complex analogue of this function is
nag_lapack_zhetrd (f08fs).
Example
This example reduces the matrix
to tridiagonal form, where
Open in the MATLAB editor:
f08fe_example
function f08fe_example
fprintf('f08fe example results\n\n');
uplo = 'L';
a = [ 2.07, 0, 0, 0;
3.87, -0.21, 0, 0;
4.2, 1.87, 1.15, 0;
-1.15, 0.63, 2.06, -1.81];
n = size(a,1);
[~, d, e, tau, info] = f08fe( ...
uplo, a);
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), e(j));
end
fprintf('%5d%12.5f\n', n, d(n));
f08fe example results
Diagonal and off-diagonal elements of tridiagonal form
i D E
1 2.07000 -5.82575
2 1.47409 2.62405
3 -0.64916 0.91627
4 -1.69493
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015