PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_matop_real_symm_posdef_geneig (f01bv)
Purpose
nag_matop_real_symm_posdef_geneig (f01bv) transforms the generalized symmetric-definite eigenproblem
to the equivalent standard eigenproblem
, where
,
and
are symmetric band matrices and
is positive definite.
must have been decomposed by
nag_matop_real_symm_posdef_fac (f01bu).
Syntax
[
a,
b,
ifail] = f01bv(
k,
a,
b, 'n',
n, 'ma1',
ma1, 'mb1',
mb1)
[
a,
b,
ifail] = nag_matop_real_symm_posdef_geneig(
k,
a,
b, 'n',
n, 'ma1',
ma1, 'mb1',
mb1)
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 22: |
ma1 and mb1 were made optional |
Description
is a symmetric band matrix of order
and bandwidth
. The positive definite symmetric band matrix
, of order
and bandwidth
, must have been previously decomposed by
nag_matop_real_symm_posdef_fac (f01bu) as
.
nag_matop_real_symm_posdef_geneig (f01bv) applies
,
and
to
,
rows at a time, restoring the band form of
at each stage by plane rotations. The argument
defines the change-over point in the decomposition of
as used by
nag_matop_real_symm_posdef_fac (f01bu) and is also used as a change-over point in the transformations applied by this function. For maximum efficiency,
should be chosen to be the multiple of
nearest to
. The resulting symmetric band matrix
is overwritten on
a. The eigenvalues of
, and thus of the original problem, may be found using
nag_lapack_dsbtrd (f08he) and
nag_lapack_dsterf (f08jf). For selected eigenvalues, use
nag_lapack_dsbtrd (f08he) and
nag_lapack_dstebz (f08jj).
References
Crawford C R (1973) Reduction of a band-symmetric generalized eigenvalue problem Comm. ACM 16 41–44
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
Suggested value:
the optimum value is the multiple of nearest to .
, the change-over point in the transformations. It must be the same as the value used by
nag_matop_real_symm_posdef_fac (f01bu) in the decomposition of
.
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 need not be set. 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-ma1+1):j
a(i-j+ma1,j) = matrix(i,j);
end
end
- 3:
– double array
-
ldb, the first dimension of the array, must satisfy the constraint
.
The elements of the decomposition of matrix
as returned by
nag_matop_real_symm_posdef_fac (f01bu).
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the second dimension of the arrays
a,
b. (An error is raised if these dimensions are not equal.)
, the order of the matrices , and .
- 2:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a.
, where is the number of nonzero superdiagonals in . Normally .
- 3:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
b.
, where is the number of nonzero superdiagonals in .
Constraint:
.
Output Parameters
- 1:
– double array
-
Stores the corresponding elements of .
- 2:
– double array
-
The elements of
b will have been permuted.
- 3:
– 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:
-
-
-
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
In general the computed system is exactly congruent to a problem
, where
and
are of the order of
and
respectively, where
is the condition number of
with respect to inversion and
is the
machine precision. This means that when
is positive definite but not well-conditioned with respect to inversion, the method, which effectively involves the inversion of
, may lead to a severe loss of accuracy in well-conditioned eigenvalues.
Further Comments
The time taken by nag_matop_real_symm_posdef_geneig (f01bv) is approximately proportional to and the distance of from , e.g., and take longer.
When is positive definite and well-conditioned with respect to inversion, the generalized symmetric eigenproblem can be reduced to the standard symmetric problem where and , the Cholesky factorization.
When
and
are of band form, especially if the bandwidth is small compared with the order of the matrices, storage considerations may rule out the possibility of working with
since it will be a full matrix in general. However, for any factorization of the form
, the generalized symmetric problem reduces to the standard form
and there does exist a factorization such that
is still of band form (see
Crawford (1973)). Writing
the standard form is
and the bandwidth of
is the maximum bandwidth of
and
.
Each stage in the transformation consists of two phases. The first reduces a leading principal sub-matrix of to the identity matrix and this introduces nonzero elements outside the band of . In the second, further transformations are applied which leave the reduced part of unaltered and drive the extra elements upwards and off the top left corner of . Alternatively, may be reduced to the identity matrix starting at the bottom right-hand corner and the extra elements introduced in can be driven downwards.
The advantage of the decomposition of is that no extra elements have to be pushed over the whole length of . If is taken as approximately , the shifting is limited to halfway. At each stage the size of the triangular bumps produced in depends on the number of rows and columns of which are eliminated in the first phase and on the bandwidth of . The number of rows and columns over which these triangles are moved at each step in the second phase is equal to the bandwidth of .
In this function,
a is defined as being at least as wide as
and must be filled out with zeros if necessary as it is overwritten with
. The number of rows and columns of
which are effectively eliminated at each stage is
.
Example
This example finds the three smallest eigenvalues of
, where
Open in the MATLAB editor:
f01bv_example
function f01bv_example
fprintf('f01bv example results\n\n');
n = 9;
kd = int64(1);
a = [ 0, 12, 13, 14, 15, 16, 17, 18, 19;
11, 12, 13, 14, 15, 16, 17, 18, 19];
b = [ 0, 22, 23, 24, 25, 26, 27, 28, 29;
101, 102, 103, 104, 105, 106, 107, 108, 109];
k = int64(4);
[b, ifail] = f01bu(k, b);
[c, b, ifail] = f01bv(k, a, b);
vect = 'No vectors';
uplo = 'Upper';
q = zeros(n, n);
[~, d, e, ~, info] = f08he( ...
vect, uplo, kd, c, q);
m1 = int64(1);
m2 = int64(3);
range = 'Indexed';
order = 'Blocked';
vl = 0;
vu = 0;
abstol = 0;
[m, nsplit, w, iblock, isplit, info] = ...
f08jj( ...
range, order, vl, vu, m1, m2, abstol, d, e);
disp('Selected eigenvalues');
disp(w(1:m)');
f01bv example results
Selected eigenvalues
-0.2643 -0.1530 -0.0418
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015