hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_lapack_dstebz (f08jj)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

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 T.
It searches for zero or negligible off-diagonal elements of T to see if the matrix splits into block diagonal form:
T = T1 T2 . . . Tp .  
It performs bisection on each of the blocks Ti 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:     range – string (length ≥ 1)
Indicates which eigenvalues are required.
range='A'
All the eigenvalues are required.
range='V'
All the eigenvalues in the half-open interval (vl,vu] are required.
range='I'
Eigenvalues with indices il to iu are required.
Constraint: range='A', 'V' or 'I'.
2:     order – string (length ≥ 1)
Indicates the order in which the eigenvalues and their block numbers are to be stored.
order='B'
The eigenvalues are to be grouped by split-off block and ordered from smallest to largest within each block.
order='E'
The eigenvalues for the entire matrix are to be ordered from smallest to largest.
Constraint: order='B' or 'E'.
3:     vl – double scalar
4:     vu – double scalar
If range='V', the lower and upper bounds, respectively, of the half-open interval
(vl,vu] within which the required eigenvalues lie.
If range='A' or 'I', vl is not referenced.
Constraint: if range='V', vl<vu.
5:     il int64int32nag_int scalar
6:     iu int64int32nag_int scalar
If range='I', the indices of the first and last eigenvalues, respectively, to be computed (assuming that the eigenvalues are in ascending order).
If range='A' or 'V', il is not referenced.
Constraint: if range='I', 1 il iu n .
7:     abstol – 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 abstol. If abstol0.0, then the tolerance is taken as machine precision×T1.
8:     d: – double array
The dimension of the array d must be at least max1,n
The diagonal elements of the tridiagonal matrix T.
9:     e: – double array
The dimension of the array e must be at least max1,n-1
The off-diagonal elements of the tridiagonal matrix T.

Optional Input Parameters

1:     n 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.)
n, the order of the matrix T.
Constraint: n0.

Output Parameters

1:     m int64int32nag_int scalar
m, the actual number of eigenvalues found.
2:     nsplit int64int32nag_int scalar
The number of diagonal blocks which constitute the tridiagonal matrix T.
3:     wn – double array
The required eigenvalues of the tridiagonal matrix T stored in w1 to wm.
4:     iblockn int64int32nag_int array
At each row/column j where ej is zero or negligible, T is considered to split into a block diagonal matrix and iblocki contains the block number of the eigenvalue stored in wi, for i=1,2,,m. Note that iblocki<0 for some i whenever info=1 or 3 (see Error Indicators and Warnings) and range='A' or 'V'.
5:     isplitn int64int32nag_int array
The leading nsplit elements contain the points at which T splits up into sub-matrices as follows. The first sub-matrix consists of rows/columns 1 to isplit1, the second sub-matrix consists of rows/columns isplit1+1 to isplit2, , and the nsplit(th) sub-matrix consists of rows/columns isplitnsplit-1+1 to isplitnsplit (=n).
6:     info int64int32nag_int scalar
info=0 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.

   info=-i
If info=-i, parameter i 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  info=1
If range='A' or 'V', the algorithm failed to compute some (or all) of the required eigenvalues to the required accuracy. More precisely, iblocki<0 indicates that eigenvalue i (stored in wi) failed to converge.
   info=2
If range='I', the algorithm failed to compute some (or all) of the required eigenvalues. Try calling the function again with range='A'.
   info=3
If range='I', see the description above for info=2.
If range='A' or 'V', see the description above for info=1.
   info=4
No eigenvalues have been computed. The floating-point arithmetic on the computer is not behaving as expected.
If failures with info1 are causing persistent trouble and you have checked that the function is being called correctly, please contact NAG.

Accuracy

The eigenvalues of T 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 QR 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).
function f08jj_example


fprintf('f08jj example results\n\n');

% Find eigenvalues 1:2 of Symmetric matrix A
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];

% Reduce to tridiagonal form
uplo = 'L';
[apt, d, e, tau, info] = f08fe( ...
				uplo, a);

% Get eigenvalues 1:2 of T (= eigenvalues of 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);

% Get corresponding eigenvectors of T
[v, ifailv, info] = f08jk( ...
			   d, e, m, w, iblock, isplit);

% Transform Q*V to get eigenvectors of A 
side = 'Left';
trans = 'No transpose';
[z, info] = f08fg( ...
                   side, uplo, trans, apt, tau, v);

% Normalize eigenvectors: largest element positive
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)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015