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_dsbgst (f08ue)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_lapack_dsbgst (f08ue) reduces a real symmetric-definite generalized eigenproblem Az=λBz to the standard form Cy=λy, where A and B are band matrices, A is a real symmetric matrix, and B has been factorized by nag_lapack_dpbstf (f08uf).

Syntax

[ab, x, info] = f08ue(vect, uplo, ka, kb, ab, bb, 'n', n)
[ab, x, info] = nag_lapack_dsbgst(vect, uplo, ka, kb, ab, bb, 'n', n)

Description

To reduce the real symmetric-definite generalized eigenproblem Az=λBz to the standard form Cy=λy, where A, B and C are banded, nag_lapack_dsbgst (f08ue) must be preceded by a call to nag_lapack_dpbstf (f08uf) which computes the split Cholesky factorization of the positive definite matrix B: B=STS. The split Cholesky factorization, compared with the ordinary Cholesky factorization, allows the work to be approximately halved.
This function overwrites A with C=XTAX, where X=S-1Q and Q is a orthogonal matrix chosen (implicitly) to preserve the bandwidth of A. The function also has an option to allow the accumulation of X, and then, if z is an eigenvector of C, Xz is an eigenvector of the original system.

References

Crawford C R (1973) Reduction of a band-symmetric generalized eigenvalue problem Comm. ACM 16 41–44
Kaufman L (1984) Banded eigenvalue solvers on vector machines ACM Trans. Math. Software 10 73–86

Parameters

Compulsory Input Parameters

1:     vect – string (length ≥ 1)
Indicates whether X is to be returned.
vect='N'
X is not returned.
vect='V'
X is returned.
Constraint: vect='N' or 'V'.
2:     uplo – string (length ≥ 1)
Indicates whether the upper or lower triangular part of A is stored.
uplo='U'
The upper triangular part of A is stored.
uplo='L'
The lower triangular part of A is stored.
Constraint: uplo='U' or 'L'.
3:     ka int64int32nag_int scalar
If uplo='U', the number of superdiagonals, ka, of the matrix A.
If uplo='L', the number of subdiagonals, ka, of the matrix A.
Constraint: ka0.
4:     kb int64int32nag_int scalar
If uplo='U', the number of superdiagonals, kb, of the matrix B.
If uplo='L', the number of subdiagonals, kb, of the matrix B.
Constraint: kakb0.
5:     abldab: – double array
The first dimension of the array ab must be at least ka+1.
The second dimension of the array ab must be at least max1,n.
The upper or lower triangle of the n by n symmetric band matrix A.
The matrix is stored in rows 1 to ka+1, more precisely,
  • if uplo='U', the elements of the upper triangle of A within the band must be stored with element Aij in abka+1+i-jj​ for ​max1,j-kaij;
  • if uplo='L', the elements of the lower triangle of A within the band must be stored with element Aij in ab1+i-jj​ for ​jiminn,j+ka.
6:     bbldbb: – double array
The first dimension of the array bb must be at least kb+1.
The second dimension of the array bb must be at least max1,n.
The banded split Cholesky factor of B as specified by uplo, n and kb and returned by nag_lapack_dpbstf (f08uf).

Optional Input Parameters

1:     n int64int32nag_int scalar
Default: the second dimension of the arrays ab, bb.
n, the order of the matrices A and B.
Constraint: n0.

Output Parameters

1:     abldab: – double array
The first dimension of the array ab will be ka+1.
The second dimension of the array ab will be max1,n.
The upper or lower triangle of ab stores the corresponding upper or lower triangle of C as specified by uplo.
2:     xldx: – double array
The first dimension, ldx, of the array x will be
  • if vect='V', ldx= max1,n ;
  • if vect='N', ldx=1.
The second dimension of the array x will be max1,n if vect='V' and at least 1 if vect='N'.
The n by n matrix X=S-1Q, if vect='V'.
If vect='N', x is not referenced.
3:     info int64int32nag_int scalar
info=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

   info=-i
If info=-i, parameter i had an illegal value on entry. The parameters are numbered as follows:
1: vect, 2: uplo, 3: n, 4: ka, 5: kb, 6: ab, 7: ldab, 8: bb, 9: ldbb, 10: x, 11: ldx, 12: work, 13: 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

Forming the reduced matrix C is a stable procedure. However it involves implicit multiplication by B-1. When nag_lapack_dsbgst (f08ue) is used as a step in the computation of eigenvalues and eigenvectors of the original problem, there may be a significant loss of accuracy if B is ill-conditioned with respect to inversion.

Further Comments

The total number of floating-point operations is approximately 6n2kB, when vect='N', assuming nkA,kB; there are an additional 3/2n3kB/kA operations when vect='V'.
The complex analogue of this function is nag_lapack_zhbgst (f08us).

Example

This example computes all the eigenvalues of Az=λBz, where
A = 0.24 0.39 0.42 0.00 0.39 -0.11 0.79 0.63 0.42 0.79 -0.25 0.48 0.00 0.63 0.48 -0.03   and  B= 2.07 0.95 0.00 0.00 0.95 1.69 -0.29 0.00 0.00 -0.29 0.65 -0.33 0.00 0.00 -0.33 1.17 .  
Here A is symmetric, B is symmetric positive definite, and A and B are treated as band matrices. B must first be factorized by nag_lapack_dpbstf (f08uf). The program calls nag_lapack_dsbgst (f08ue) to reduce the problem to the standard form Cy=λy, then nag_lapack_dsbtrd (f08he) to reduce C to tridiagonal form, and nag_lapack_dsterf (f08jf) to compute the eigenvalues.
function f08ue_example


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

% Sove Az = lambda Bz
% A and B are the symmetric banded positive definite matrices:
n = 4;
% A has 2 off-diagonals
ka = int64(2); 
a = [ 0.24,  0.39,  0.42,  0.00;
      0.39, -0.11,  0.79,  0.63;
      0.42,  0.79, -0.25,  0.48;
      0.00,  0.63,  0.48, -0.03];
% B has 1 off-diagonal
kb = int64(1); 
b = [ 2.07   0.95   0.00   0.00;
      0.95   1.69  -0.29   0.00;
      0.00  -0.29   0.65  -0.33;
      0.00   0.00  -0.33   1.17];

% Convert to general banded format ...
[~, ab, ifail] = f01zc( ...
			'P', ka, ka, a, zeros(ka+ka+1,n));
[~, bb, ifail] = f01zc( ...
			'P', kb, kb, b, zeros(kb+kb+1,n));
% ... and chop to give 'Upper' symmetric banded format
ab = ab(1:ka+1,1:n);
bb = bb(1:kb+1,1:n);

% Factorize B
uplo = 'Upper';
[ub, info] = f08uf( ...
		    uplo, kb, bb);

% Reduce problem to standard form Cy = lambda*y
vect = 'N';
[cb, x, info] = f08ue( ...
		       vect, uplo, ka, kb, ab, ub);

% Find eigenvalues lambda
jobz = 'No Vectors';
[~, w, ~, info] = f08ha( ...
			 jobz, uplo, ka, cb);

disp('Eigenvalues:');
disp(w');


f08ue example results

Eigenvalues:
   -0.8305   -0.6401    0.0992    1.8525


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