PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dstebz (f08jj)
Purpose
nag_lapack_dstebz (f08jj) computes some (or all) of the eigenvalues of a real symmetric tridiagonal matrix, by bisection.
Syntax
[
m,
nsplit,
w,
iblock,
isplit,
info] = f08jj(
range,
order,
vl,
vu,
il,
iu,
abstol,
d,
e, 'n',
n)
[
m,
nsplit,
w,
iblock,
isplit,
info] = nag_lapack_dstebz(
range,
order,
vl,
vu,
il,
iu,
abstol,
d,
e, 'n',
n)
Description
nag_lapack_dstebz (f08jj) uses bisection to compute some or all of the eigenvalues of a real symmetric tridiagonal matrix .
It searches for zero or negligible off-diagonal elements of
to see if the matrix splits into block diagonal form:
It performs bisection on each of the blocks
and returns the block index of each computed eigenvalue, so that a subsequent call to
nag_lapack_dstein (f08jk) to compute eigenvectors can also take advantage of the block structure.
References
Kahan W (1966) Accurate eigenvalues of a symmetric tridiagonal matrix Report CS41 Stanford University
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates which eigenvalues are required.
- All the eigenvalues are required.
- All the eigenvalues in the half-open interval (vl,vu] are required.
- Eigenvalues with indices il to iu are required.
Constraint:
, or .
- 2:
– string (length ≥ 1)
-
Indicates the order in which the eigenvalues and their block numbers are to be stored.
- The eigenvalues are to be grouped by split-off block and ordered from smallest to largest within each block.
- The eigenvalues for the entire matrix are to be ordered from smallest to largest.
Constraint:
or .
- 3:
– double scalar
- 4:
– double scalar
-
If
, the lower and upper bounds, respectively, of the half-open interval
(
vl,
vu] within which the required eigenvalues lie.
If
or
,
vl is not referenced.
Constraint:
if , .
- 5:
– int64int32nag_int scalar
- 6:
– int64int32nag_int scalar
-
If
, the indices of the first and last eigenvalues, respectively, to be computed (assuming that the eigenvalues are in ascending order).
If
or
,
il is not referenced.
Constraint:
if , .
- 7:
– double scalar
-
The absolute tolerance to which each eigenvalue is required. An eigenvalue (or cluster) is considered to have converged if it lies in an interval of width . If , then the tolerance is taken as .
- 8:
– double array
-
The dimension of the array
d
must be at least
The diagonal elements of the tridiagonal matrix .
- 9:
– double array
-
The dimension of the array
e
must be at least
The off-diagonal elements of the tridiagonal matrix .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
d and the second dimension of the array
d. (An error is raised if these dimensions are not equal.)
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– int64int32nag_int scalar
-
, the actual number of eigenvalues found.
- 2:
– int64int32nag_int scalar
-
The number of diagonal blocks which constitute the tridiagonal matrix .
- 3:
– double array
-
The required eigenvalues of the tridiagonal matrix stored in to .
- 4:
– int64int32nag_int array
-
At each row/column
where
is zero or negligible,
is considered to split into a block diagonal matrix and
contains the block number of the eigenvalue stored in
, for
. Note that
for some
whenever
or
(see
Error Indicators and Warnings) and
or
.
- 5:
– int64int32nag_int array
-
The leading
nsplit elements contain the points at which
splits up into sub-matrices as follows. The first sub-matrix consists of rows/columns
to
, the second sub-matrix consists of rows/columns
to
,
, and the
nsplit(th) sub-matrix consists of rows/columns
to
(
).
- 6:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
If , parameter had an illegal value on entry. The parameters are numbered as follows:
1:
range, 2:
order, 3:
n, 4:
vl, 5:
vu, 6:
il, 7:
iu, 8:
abstol, 9:
d, 10:
e, 11:
m, 12:
nsplit, 13:
w, 14:
iblock, 15:
isplit, 16:
work, 17:
iwork, 18:
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.
- W
-
If or , the algorithm failed to compute some (or all) of the required eigenvalues to the required accuracy. More precisely, indicates that eigenvalue (stored in ) failed to converge.
-
-
If , the algorithm failed to compute some (or all) of the required eigenvalues. Try calling the function again with .
-
-
If , see the description above for .
If or , see the description above for .
-
-
No eigenvalues have been computed. The floating-point arithmetic on the computer is not behaving as expected.
If failures with
are causing persistent trouble and you have checked that the function is being called correctly, please contact
NAG.
Accuracy
The eigenvalues of are computed to high relative accuracy which means that if they vary widely in magnitude, then any small eigenvalues will be computed more accurately than, for example, with the standard method. However, the reduction to tridiagonal form (prior to calling the function) may exclude the possibility of obtaining high relative accuracy in the small eigenvalues of the original matrix if its eigenvalues vary widely in magnitude.
Further Comments
There is no complex analogue of this function.
Example
See
Example in
nag_lapack_dormtr (f08fg).
Open in the MATLAB editor:
f08jj_example
function f08jj_example
fprintf('f08jj example results\n\n');
a = [ 2.07, 0, 0, 0;
3.87, -0.21, 0, 0;
4.20, 1.87, 1.15, 0;
-1.15, 0.63, 2.06, -1.81];
uplo = 'L';
[apt, d, e, tau, info] = f08fe( ...
uplo, a);
vl = 0;
vu = 0;
il = int64(1);
iu = int64(2);
abstol = 0;
[m, ~, w, iblock, isplit, info] = ...
f08jj(...
'I', 'B', vl, vu, il, iu, abstol, d, e);
[v, ifailv, info] = f08jk( ...
d, e, m, w, iblock, isplit);
side = 'Left';
trans = 'No transpose';
[z, info] = f08fg( ...
side, uplo, trans, apt, tau, v);
for j = 1:m
[~,k] = max(abs(z(:,j)));
if z(k,j) < 0;
z(:,j) = -z(:,j);
end
end
fprintf(' Eigenvalues numbered 1 to 2 are:\n ');
fprintf(' %7.4f',w(1:m));
fprintf('\n\n');
[ifail] = x04ca( ...
'General', ' ', z, 'Corresponding eigenvectors of A');
f08jj example results
Eigenvalues numbered 1 to 2 are:
-5.0034 -1.9987
Corresponding eigenvectors of A
1 2
1 0.5658 -0.2328
2 -0.3478 0.7994
3 -0.4740 -0.4087
4 0.5781 0.3737
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015