PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zpbequ (f07ht)
Purpose
nag_lapack_zpbequ (f07ht) computes a diagonal scaling matrix intended to equilibrate a complex by Hermitian positive definite band matrix , with bandwidth , and reduce its condition number.
Syntax
Description
nag_lapack_zpbequ (f07ht) computes a diagonal scaling matrix
chosen so that
This means that the matrix
given by
has diagonal elements equal to unity. This in turn means that the condition number of
,
, is within a factor
of the matrix of smallest possible condition number over all possible choices of diagonal scalings (see Corollary 7.6 of
Higham (2002)).
References
Higham N J (2002) Accuracy and Stability of Numerical Algorithms (2nd Edition) SIAM, Philadelphia
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates whether the upper or lower triangular part of
is stored in the array
ab, as follows:
- The upper triangle of is stored.
- The lower triangle of is stored.
Constraint:
or .
- 2:
– int64int32nag_int scalar
-
, the number of superdiagonals of the matrix if , or the number of subdiagonals if .
Constraint:
.
- 3:
– complex array
-
The first dimension of the array
ab must be at least
.
The second dimension of the array
ab must be at least
.
The upper or lower triangle of the Hermitian positive definite band matrix
whose scaling factors are to be computed.
The matrix is stored in rows
to
, more precisely,
- if , the elements of the upper triangle of within the band must be stored with element in ;
- if , the elements of the lower triangle of within the band must be stored with element in
Only the elements of the array
ab corresponding to the diagonal elements of
are referenced. (Row
of
ab when
, row
of
ab when
.)
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the second dimension of the array
ab.
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– double array
-
If
,
s contains the diagonal elements of the scaling matrix
.
- 2:
– double scalar
-
If
,
scond contains the ratio of the smallest value of
s to the largest value of
s. If
and
amax is neither too large nor too small, it is not worth scaling by
.
- 3:
– double scalar
-
. If
amax is very close to overflow or underflow, the matrix
should be scaled.
- 4:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
-
-
The th diagonal element of is not positive
(and hence cannot be positive definite).
Accuracy
The computed scale factors will be close to the exact scale factors.
Further Comments
The real analogue of this function is
nag_lapack_dpbequ (f07hf).
Example
This example equilibrates the Hermitian positive definite matrix
given by
Details of the scaling factors and the scaled matrix are output.
Open in the MATLAB editor:
f07ht_example
function f07ht_example
fprintf('f07ht example results\n\n');
uplo = 'U';
kd = int64(1);
n = int64(4);
ab = [0, 1.08 - 1.73i, -0.04e10 + 0.29e10i, -0.33e10 + 2.24e10i;
9.39 + 0i, 1.69 + 0i, 2.65e20 + 0i, 2.17 + 0i];
[s, scond, amax, info] = f07ht( ...
uplo, kd, ab);
fprintf('scond = %8.1e, amax = %8.1e\n\n', scond, amax);
disp('Diagonal scaling factors');
fprintf('%10.1e',s);
fprintf('\n\n');
asp = ab*diag(s);
for i = 1:n
for j = 0:min(kd,n-i)
asp(kd+1-j,i+j) = s(i)*asp(kd+1-j,i+j);
end
end
kl = int64(0);
[ifail] = x04de( ...
n, n, kl, kd, asp, 'Scaled matrix');
f07ht example results
scond = 8.0e-11, amax = 2.6e+20
Diagonal scaling factors
3.3e-01 7.7e-01 6.1e-11 6.8e-01
Scaled matrix
1 2 3 4
1 1.0000 0.2711
0.0000 -0.4343
2 1.0000 -0.0189
0.0000 0.1370
3 1.0000 -0.1376
0.0000 0.9341
4 1.0000
0.0000
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015