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_dpbstf (f08uf)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_lapack_dpbstf (f08uf) computes a split Cholesky factorization of a real symmetric positive definite band matrix.

Syntax

[bb, info] = f08uf(uplo, kb, bb, 'n', n)
[bb, info] = nag_lapack_dpbstf(uplo, kb, bb, 'n', n)

Description

nag_lapack_dpbstf (f08uf) computes a split Cholesky factorization of a real symmetric positive definite band matrix B. It is designed to be used in conjunction with nag_lapack_dsbgst (f08ue).
The factorization has the form B=STS, where S is a band matrix of the same bandwidth as B and the following structure: S is upper triangular in the first n+k/2 rows, and transposed — hence, lower triangular — in the remaining rows. For example, if n=9 and k=2, then
S = s11 s12 s13 s22 s23 s24 s33 s34 s35 s44 s45 s55 s64 s65 s66 s75 s76 s77 s86 s87 s88 s97 s98 s99 .  

References

None.

Parameters

Compulsory Input Parameters

1:     uplo – string (length ≥ 1)
Indicates whether the upper or lower triangular part of B is stored.
uplo='U'
The upper triangular part of B is stored.
uplo='L'
The lower triangular part of B is stored.
Constraint: uplo='U' or 'L'.
2:     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: kb0.
3:     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 n by n symmetric positive definite band matrix B.
The matrix is stored in rows 1 to kb+1, more precisely,
  • if uplo='U', the elements of the upper triangle of B within the band must be stored with element Bij in bbkb+1+i-jj​ for ​max1,j-kbij;
  • if uplo='L', the elements of the lower triangle of B within the band must be stored with element Bij in bb1+i-jj​ for ​jiminn,j+kb.

Optional Input Parameters

1:     n int64int32nag_int scalar
Default: the first dimension of the array bb and the second dimension of the array bb. (An error is raised if these dimensions are not equal.)
n, the order of the matrix B.
Constraint: n0.

Output Parameters

1:     bbldbb: – double array
The first dimension of the array bb will be kb+1.
The second dimension of the array bb will be max1,n.
B stores the elements of its split Cholesky factor S.
2:     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: uplo, 2: n, 3: kb, 4: bb, 5: ldbb, 6: 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.
   info>0
If info=i, the factorization could not be completed, because the updated element bi,i would be the square root of a negative number. Hence B is not positive definite. This may indicate an error in forming the matrix B.

Accuracy

The computed factor S is the exact factor of a perturbed matrix B+E, where
Eck+1εSTS,  
ck+1 is a modest linear function of k+1, and ε is the machine precision. It follows that eijck+1εbiibjj.

Further Comments

The total number of floating-point operations is approximately n k+1 2, assuming nk.
A call to nag_lapack_dpbstf (f08uf) may be followed by a call to nag_lapack_dsbgst (f08ue) to solve the generalized eigenproblem Az=λBz, where A and B are banded and B is positive definite.
The complex analogue of this function is nag_lapack_zpbstf (f08ut).

Example

See Example in nag_lapack_dsbgst (f08ue).
function f08uf_example


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

% Sove Az = lambda Bz
% A and B are the symmetric banded positive definite matrices:
n = 4;
% A has 2 off-diagionals
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');


f08uf 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