PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zppequ (f07gt)
Purpose
nag_lapack_zppequ (f07gt) computes a diagonal scaling matrix intended to equilibrate a complex by Hermitian positive definite matrix , stored in packed format, and reduce its condition number.
Syntax
Description
nag_lapack_zppequ (f07gt) 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
ap, as follows:
- The upper triangle of is stored.
- The lower triangle of is stored.
Constraint:
or .
- 2:
– int64int32nag_int scalar
-
, the order of the matrix .
Constraint:
.
- 3:
– complex array
-
The dimension of the array
ap
must be at least
The
by
Hermitian matrix
, packed by columns.
More precisely,
- if , the upper triangle of must be stored with element in for ;
- if , the lower triangle of must be stored with element in for .
Only the elements of
ap corresponding to the diagonal elements
are referenced.
Optional Input Parameters
None.
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_dppequ (f07gf).
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:
f07gt_example
function f07gt_example
fprintf('f07gt example results\n\n');
uplo = 'Upper';
n = int64(4);
ap = [ 3.23 + 0i, ...
1.51 - 1.92i, 3.58 + 0i, ...
1.90e5 + 0.84e5i, -0.23e5 + 1.11e5i, 4.09e10 + 0i, ...
0.42 + 2.50i, -1.18 + 1.37i, 2.33e5 - 0.14e5i, 4.29 + 0i];
[s, scond, amax, info] = f07gt( ...
uplo, n, ap);
fprintf('scond = %8.1e, amax = %8.1e\n\n', scond, amax);
disp('Diagonal scaling factors');
fprintf('%10.1e',s);
fprintf('\n\n');
k = 0;
for i = 1:n
for j = 1:i
k = k + 1;
asp(k) = s(i)*ap(k)*s(j);
end
end
[ifail] = x04dc( ...
'Upper', 'Non-unit', n, asp, 'Scaled matrix');
f07gt example results
scond = 8.9e-06, amax = 4.1e+10
Diagonal scaling factors
5.6e-01 5.3e-01 4.9e-06 4.8e-01
Scaled matrix
1 2 3 4
1 1.0000 0.4441 0.5227 0.1128
0.0000 -0.5646 0.2311 0.6716
2 1.0000 -0.0601 -0.3011
0.0000 0.2901 0.3496
3 1.0000 0.5562
0.0000 -0.0334
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