PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_matop_real_symm_posdef_fac (f01bu)
Purpose
nag_matop_real_symm_posdef_fac (f01bu) performs a decomposition of a real symmetric positive definite band matrix.
Syntax
[
a,
ifail] = nag_matop_real_symm_posdef_fac(
k,
a, 'n',
n, 'm1',
m1)
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 22: |
m1 was made optional |
Description
The symmetric positive definite matrix , of order and bandwidth , is divided into the leading principal sub-matrix of order and its complement, where . A decomposition of the latter and an decomposition of the former are obtained by means of a sequence of elementary transformations, where is unit upper triangular, is unit lower triangular and is diagonal. Thus if , an decomposition of is obtained.
This function is specifically designed to precede
nag_matop_real_symm_posdef_geneig (f01bv) for the transformation of the symmetric-definite eigenproblem
by the method of Crawford where
and
are of band form. In this context,
is chosen to be close to
and the decomposition is applied to the matrix
.
References
Wilkinson J H (1965) The Algebraic Eigenvalue Problem Oxford University Press, Oxford
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
, the change-over point in the decomposition.
Constraint:
.
- 2:
– double array
-
lda, the first dimension of the array, must satisfy the constraint
.
The upper triangle of the
by
symmetric band matrix
, with the diagonal of the matrix stored in the
th row of the array, and the
superdiagonals within the band stored in the first
rows of the array. Each column of the matrix is stored in the corresponding column of the array. For example, if
and
, the storage scheme is
Elements in the top left corner of the array are not used. The following code assigns the matrix elements within the band to the correct elements of the array:
for j=1:n
for i=max(1,j-m1+1):j
a(i-j+m1,j) = matrix (i,j);
end
end
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the second dimension of the array
a.
, the order of the matrix .
- 2:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a.
, where is the number of nonzero superdiagonals in . Normally .
Output Parameters
- 1:
– double array
-
stores the corresponding elements of , and .
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
-
-
-
The matrix
is not positive definite, perhaps as a result of rounding errors, giving an element of
which is zero or negative.
when the failure occurs in the leading principal sub-matrix of order
k and
when it occurs in the complement.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
The Cholesky decomposition of a positive definite matrix is known for its remarkable numerical stability (see
Wilkinson (1965)). The computed
,
and
satisfy the relation
where the
-norms of
and
are related by
where
is a constant of order unity and
is the
machine precision. In practice, the error is usually appreciably smaller than this.
Further Comments
The time taken by nag_matop_real_symm_posdef_fac (f01bu) is approximately proportional to .
This function is specifically designed for use as the first stage in the solution of the generalized symmetric eigenproblem by Crawford's method which preserves band form in the transformation to a similar standard problem. In this context, for maximum efficiency, should be chosen as the multiple of nearest to .
The matrix is such that is diagonal in its last rows and columns, is such that and is diagonal. To find , and where requires multiplications and divisions which, is independent of .
Example
This example finds a
decomposition of the real symmetric positive definite matrix
Open in the MATLAB editor:
f01bu_example
function f01bu_example
fprintf('f01bu example results\n\n');
m1 = int64(3); n = int64(7);
a = [0, 0, 6, -4, 15, 4, -18;
0, -9, -2, -66, -24, -74, 24;
3, 31, 123, 145, 61, 98, 6];
k = int64(4);
[a, ifail] = f01bu(k, a);
ptitle = 'Factorized form of the matrix';
[ifail] = x04ce( ...
n, n, int64(0), m1-1, a, ptitle);
f01bu example results
Factorized form of the matrix
1 2 3 4 5 6 7
1 3.0000 -3.0000 2.0000
2 4.0000 4.0000 -1.0000
3 2.0000 5.0000 3.0000
4 3.0000 -4.0000 2.0000
5 5.0000 -1.0000 -3.0000
6 2.0000 4.0000
7 6.0000
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015